capnp

OCaml code generation plugin for the Cap'n Proto serialization framework
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library capnp
type t
val empty : unit -> t

Create a new, empty fragment buffer.

val of_string : string -> t

Create a new fragment buffer containing the contents of the string.

val byte_count : t -> int

Get the number of bytes stored in the fragment buffer.

val add_fragment : t -> string -> unit

Add a fragment to the back of the fragment buffer.

val remove_exact : t -> int -> string option

Remove a specific number of bytes from the front of the fragment buffer.

val remove_at_least : t -> int -> string option

Remove at least the specified number of bytes from the front of the fragment buffer. This is a less expensive operation than remove_exact.

val peek_exact : t -> int -> string option

Examine a specific number of bytes from the front of the fragment buffer, without removing the data.

val unremove : t -> string -> unit

Return some bytes to the front of the fragment buffer.