module Serialize: sig end
type'a
t =(Buffer.t -> 'a -> unit) * (string -> int -> int -> int * 'a)
It is a pair (writer, reader
). writer
is adds the given value
to the buffer. reader
takes a message starting position and length of
the message and returns the new position and the value that has been read
exception Too_short of string
Every serializer should check if the message is long enought to read its
value and if not should raise this exception
val unit : unit t
val char : char t
val int : int t
1b -64 to 64 2b -8k to 8k 3b -1M to 1M 4b -128M to 128M 5b bigger
val float : float t
val string : string t
Serialize.int
and the contents.val int31 : int t
val pair : 'a t -> 'b t -> ('a * 'b) t
val list : 'a t -> 'a list t
Serialize.int
and its elements concateneted.val map : 'a t -> ('a -> 'b) -> ('b -> 'a) -> 'b t
val marshal : 'a t