123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272open!ImportopenBin_prot.BinableopenBigarraymoduletypeConv_without_uuid=sigtypebinabletypetvalto_binable:t->binablevalof_binable:binable->tendmoduletypeConv1_without_uuid=sigtype'abinabletype'atvalto_binable:'at->'abinablevalof_binable:'abinable->'atendmoduletypeConv2_without_uuid=sigtype('a,'b)binabletype('a,'b)tvalto_binable:('a,'b)t->('a,'b)binablevalof_binable:('a,'b)binable->('a,'b)tendmoduletypeConv3_without_uuid=sigtype('a,'b,'c)binabletype('a,'b,'c)tvalto_binable:('a,'b,'c)t->('a,'b,'c)binablevalof_binable:('a,'b,'c)binable->('a,'b,'c)tendmoduletypeConv=sigincludeConv_without_uuidvalcaller_identity:Bin_prot.Shape.Uuid.tendmoduletypeConv1=sigincludeConv1_without_uuidvalcaller_identity:Bin_prot.Shape.Uuid.tendmoduletypeConv2=sigincludeConv2_without_uuidvalcaller_identity:Bin_prot.Shape.Uuid.tendmoduletypeConv3=sigincludeConv3_without_uuidvalcaller_identity:Bin_prot.Shape.Uuid.tendmoduletypeConv_sexpable=sigincludeSexpable.Svalcaller_identity:Bin_prot.Shape.Uuid.tendmoduletypeConv_stringable=sigincludeStringable.Svalcaller_identity:Bin_prot.Shape.Uuid.tend(** Module types and utilities for dealing with types that support the bin-io binary
encoding. *)moduletypeBinable0=sig(** We copy the definition of the bigstring type here, because we cannot depend on
bigstring.ml *)typebigstring=(char,int8_unsigned_elt,c_layout)Array1.t(** New code should use [@@deriving bin_io]. These module types ([S], [S1], and [S2])
are exported only for backwards compatibility. *)moduletypeS=SmoduletypeS_only_functions=S_only_functionsmoduletypeS1=S1moduletypeS2=S2moduletypeS3=S3moduleMinimal:sigmoduletypeS=Minimal.SmoduletypeS1=Minimal.S1moduletypeS2=Minimal.S2moduletypeS3=Minimal.S3endmoduletypeConv=ConvmoduletypeConv1=Conv1moduletypeConv2=Conv2moduletypeConv3=Conv3moduletypeConv_sexpable=Conv_sexpablemoduletypeConv_stringable=Conv_stringablemoduletypeConv_without_uuid=Conv_without_uuidmoduletypeConv1_without_uuid=Conv1_without_uuidmoduletypeConv2_without_uuid=Conv2_without_uuidmoduletypeConv3_without_uuid=Conv3_without_uuid(** [Of_binable*] functors are for when you want the binary representation of one type
to be the same as that for some other isomorphic type. *)moduleOf_binable_with_uuid(Binable:Minimal.S)(M:Convwithtypebinable:=Binable.t):Swithtypet:=M.tmoduleOf_binable1_with_uuid(Binable:Minimal.S1)(M:Conv1withtype'abinable:='aBinable.t):S1withtype'at:='aM.tmoduleOf_binable2_with_uuid(Binable:Minimal.S2)(M:Conv2withtype('a,'b)binable:=('a,'b)Binable.t):S2withtype('a,'b)t:=('a,'b)M.tmoduleOf_binable3_with_uuid(Binable:Minimal.S3)(M:Conv3withtype('a,'b,'c)binable:=('a,'b,'c)Binable.t):S3withtype('a,'b,'c)t:=('a,'b,'c)M.tmoduleOf_binable_without_uuid(Binable:Minimal.S)(M:Conv_without_uuidwithtypebinable:=Binable.t):Swithtypet:=M.t[@@alertlegacy"Use [Of_binable_with_uuid] if possible."]moduleOf_binable1_without_uuid(Binable:Minimal.S1)(M:Conv1_without_uuidwithtype'abinable:='aBinable.t):S1withtype'at:='aM.t[@@alertlegacy"Use [Of_binable1_with_uuid] if possible."]moduleOf_binable2_without_uuid(Binable:Minimal.S2)(M:Conv2_without_uuidwithtype('a,'b)binable:=('a,'b)Binable.t):S2withtype('a,'b)t:=('a,'b)M.t[@@alertlegacy"Use [Of_binable2_with_uuid] if possible."]moduleOf_binable3_without_uuid(Binable:Minimal.S3)(M:Conv3_without_uuidwithtype('a,'b,'c)binable:=('a,'b,'c)Binable.t):S3withtype('a,'b,'c)t:=('a,'b,'c)M.t[@@alertlegacy"Use [Of_binable3_with_uuid] if possible."](** [Of_sexpable_with_uuid] serializes a value using the bin-io of the sexp
serialization of the value. This is not as efficient as using [@@deriving bin_io].
However, it is useful when performance isn't important and there are obstacles to
using [@@deriving bin_io], e.g., some type missing [@@deriving bin_io].
[Of_sexpable_with_uuid] is also useful when one wants to be forgiving about format
changes, due to the sexp serialization being more robust to changes like adding or
removing a constructor. *)moduleOf_sexpable_with_uuid(M:Conv_sexpable):Swithtypet:=M.tmoduleOf_stringable_with_uuid(M:Conv_stringable):Swithtypet:=M.tmoduleOf_sexpable_without_uuid(M:Sexpable.S):Swithtypet:=M.t[@@alertlegacy"Use [Of_sexpable_with_uuid] if possible."]moduleOf_stringable_without_uuid(M:Stringable.S):Swithtypet:=M.t[@@alertlegacy"Use [Of_stringable_with_uuid] if possible."]type'am=(moduleSwithtypet='a)valof_bigstring:'am->bigstring->'avalto_bigstring:?prefix_with_length:bool(** defaults to false *)->'am->'a->bigstring(** The following functors preserve stability: if applied to stable types with stable
(de)serializations, they will produce stable types with stable (de)serializations.
Note: In all cases, stability of the input (and therefore the output) depends on the
semantics of all conversion functions (e.g. [to_string], [to_sexpable]) not changing
in the future.
*)moduleStable:sigmoduleOf_binable:sigmoduleV1:(moduletypeofOf_binable_without_uuid)[@alert"-legacy"][@@alertlegacy"Use [V2] instead."]moduleV2:moduletypeofOf_binable_with_uuidendmoduleOf_binable1:sigmoduleV1:(moduletypeofOf_binable1_without_uuid)[@alert"-legacy"][@@alertlegacy"Use [V2] instead."]moduleV2:moduletypeofOf_binable1_with_uuidendmoduleOf_binable2:sigmoduleV1:(moduletypeofOf_binable2_without_uuid)[@alert"-legacy"][@@alertlegacy"Use [V2] instead."]moduleV2:moduletypeofOf_binable2_with_uuidendmoduleOf_binable3:sigmoduleV1:(moduletypeofOf_binable3_without_uuid)[@alert"-legacy"][@@alertlegacy"Use [V2] instead."]moduleV2:moduletypeofOf_binable3_with_uuidendmoduleOf_sexpable:sigmoduleV1:(moduletypeofOf_sexpable_without_uuid)[@alert"-legacy"][@@alertlegacy"Use [V2] instead."]moduleV2:moduletypeofOf_sexpable_with_uuidendmoduleOf_stringable:sigmoduleV1:(moduletypeofOf_stringable_without_uuid)[@alert"-legacy"][@@alertlegacy"Use [V2] instead."]moduleV2:moduletypeofOf_stringable_with_uuidendendendmoduletypeBinable=sigincludeBinable0valof_string:'am->string->'avalto_string:'am->'a->stringmoduleOf_binable=Of_binable_without_uuid[@@alert"-legacy"][@@deprecated"[since 2019-11] Use [Of_binable_with_uuid] if possible, otherwise use \
[Of_binable_without_uuid]."]moduleOf_binable1=Of_binable1_without_uuid[@@alert"-legacy"][@@deprecated"[since 2019-11] Use [Of_binable1_with_uuid] if possible, otherwise use \
[Of_binable1_without_uuid]."]moduleOf_binable2=Of_binable2_without_uuid[@@alert"-legacy"][@@deprecated"[since 2019-11] Use [Of_binable2_with_uuid] if possible, otherwise use \
[Of_binable2_without_uuid]."]moduleOf_binable3=Of_binable3_without_uuid[@@alert"-legacy"][@@deprecated"[since 2019-11] Use [Of_binable3_with_uuid] if possible, otherwise use \
[Of_binable3_without_uuid]."]moduleOf_sexpable=Of_sexpable_without_uuid[@@alert"-legacy"][@@deprecated"[since 2019-11] Use [Of_sexpable_with_uuid] if possible, otherwise use \
[Of_sexpable_without_uuid]."]moduleOf_stringable=Of_stringable_without_uuid[@@alert"-legacy"][@@deprecated"[since 2019-11] Use [Of_stringable_with_uuid] if possible, otherwise use \
[Of_stringable_without_uuid]."]end