package bencode

  1. Overview
  2. Docs

Module Bencode_streaming.DecodeSource

Sourcetype t
Sourceval of_string : string -> t
Sourceval of_bytes : Bytes.t -> t
Sourceval of_chan : in_channel -> t
Sourceval manual : unit -> t
Sourcetype parse_result =
  1. | ParseOk of bencode
  2. | ParseError of string
  3. | ParseEnd
    (*

    end of input

    *)
  4. | ParsePartial
    (*

    Await more input

    *)
Sourceval feed : t -> string -> int -> int -> unit

Provide some more input (the subtstring). Only useful for manual, non-blocking parsing.

Sourceval feed_bytes : t -> Bytes.t -> int -> int -> unit
Sourceval next : t -> parse_result

Parse next value

Sourceval parse_string : string -> bencode option

Parse the string.

Sourceval parse_string_exn : string -> bencode
  • raises Failure

    if it fails to parse.

OCaml

Innovation. Community. Security.