package bencode

  1. Overview
  2. Docs
val size : bencode -> int

Size needed for serialization, in bytes

val write_in_string : t -> Bytes.t -> int -> unit

write_in_string v buf o writes the value v in the string, starting at offset o. The portion of the string starting from o must be big enough (ie >= size v)

val to_buf : Buffer.t -> t -> unit
val to_string : t -> string
val to_bytes : t -> Bytes.t
val to_chan : out_channel -> t -> unit
val fmt : Format.formatter -> t -> unit

Traverse the Bencode value as a sequence of tokens

val to_list : bencode -> Bencode_token.t list
val put : Bencode_token.Encode.t -> t -> unit

Put the whole value on the given token encoder