package DkSDKFFIOCaml_Std

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Serialization and deserialization protocols.

The module is meant for persisting messages to and from storage, or transmitting and receiving messages over the wire.

Do not use this module for FFI.

type compression_t = [
  1. | `None
  2. | `Packing
]
module FramingError : sig ... end
module FramedStreamC : sig ... end
val serialize_fold : 'cap Capnp__Message.Make(DkSDKFFIOCaml_Std__.Ffi_message.HostStorageC).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 Capnp__Message.Make(DkSDKFFIOCaml_Std__.Ffi_message.HostStorageC).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 Capnp__Message.Make(DkSDKFFIOCaml_Std__.Ffi_message.HostStorageC).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 Capnp__Message.Make(DkSDKFFIOCaml_Std__.Ffi_message.HostStorageC).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 Capnp__Message.Make(DkSDKFFIOCaml_Std__.Ffi_message.HostStorageC).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.