package capnp

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type compression_t = [
  1. | `None
  2. | `Packing
]
module FramingError : sig ... end
module FramedStream : sig ... end
val serialize_fold : 'cap Message.BytesMessage.Message.t -> compression:compression_t -> init:'acc -> f:('acc -> string -> 'acc) -> 'acc

serialize_fold message ~compression ~init ~f generates an ordered sequence of string fragments corresponding to a Cap'n Proto framed message, encoded using the specified compression method. The return value is the result of folding f across the resulting sequence of fragments.

val serialize_iter : 'cap Message.BytesMessage.Message.t -> compression:compression_t -> f:(string -> unit) -> unit

serialize_iter message ~compression ~f generates an ordered sequence of string fragments corresponding to a Cap'n Proto framed message, encoded using the specified compression method. f is applied to each fragment in turn.

val serialize_fold_copyless : 'cap Message.BytesMessage.Message.t -> compression:compression_t -> init:'acc -> f:('acc -> string -> int -> 'acc) -> 'acc

serialize_fold_copyless message ~compression ~init ~f exposes an ordered sequence of string fragments (and lengths) corresponding to a Cap'n Proto framed message, encoded using the specified compression method. The return value is the result of folding f across the resulting sequence of fragments.

val serialize_iter_copyless : 'cap Message.BytesMessage.Message.t -> compression:compression_t -> f:(string -> int -> unit) -> unit

serialize_iter_copyless message ~compression ~f exposes an ordered sequence of string fragments (and lengths) corresponding to a Cap'n Proto framed message, encoded using the specified compression method. f is applied to each fragment in turn.

val serialize : compression:compression_t -> 'cap Message.BytesMessage.Message.t -> string

serialize ~compression message constructs a string containing the message segments prefixed with the serialization framing header, encoded using the specified compression method.

OCaml

Innovation. Community. Security.