Module Tjr_fs_shared.Marshal_factory
Common marshallers
type ('a, 'buf) mshlr
=
{
max_elt_sz : int;
mshl : 'a -> ('buf * int) -> 'buf * int;
umshl : 'buf -> int -> 'a * int;
}
Generic marshaller type, assuming max_elt_sz is known (alternative is to marshal and check for end of buffer explicitly)
type ('k, 'v, 'buf) kv_mshlr
=
{
k_mshlr : ('k, 'buf) mshlr;
v_mshlr : ('v, 'buf) mshlr;
}
A pair of marshallers, one for keys, one for values
module Make_marshaller : functor (X : sig ... end) -> sig ... end
Functor to construct a marshaller from a type deriving bin_io
val mshlrs : < for_blk_id : (Blk_intf.Blk_id_as_int.blk_id, Shared_ctxt.buf) mshlr; for_blk_id_option : (Blk_intf.Blk_id_as_int.blk_id option, Shared_ctxt.buf) mshlr; for_int : (int, Shared_ctxt.buf) mshlr; for_int_int_kvop : ((int, int) Kvop.kvop, Shared_ctxt.buf) mshlr; for_int_int_kvop_option : ((int, int) Kvop.kvop option, Shared_ctxt.buf) mshlr; for_int_option : (int option, Shared_ctxt.buf) mshlr; for_kv : < int_int : (int, int, Shared_ctxt.buf) kv_mshlr; s256_int : (Str_256.str_256, int, Shared_ctxt.buf) kv_mshlr; s256_s256 : (Str_256.str_256, Str_256.str_256, Shared_ctxt.buf) kv_mshlr; >; for_s256 : (Str_256.str_256, Shared_ctxt.buf) mshlr; >