Module Imandra_util.Serialize
Serialization
val encode_bytes : ?flags:flags list -> 'a t -> 'a -> bytes
val encode_str : ?flags:flags list -> 'a t -> 'a -> string
val encode_chan : ?flags:flags list -> Stdlib.out_channel -> 'a t -> 'a -> unit
val encode_fd_block : ?flags:flags list -> poll_read:(unit -> Unix.file_descr list) -> chs:IO_chunk.t list -> Unix.file_descr -> 'a t -> 'a -> unit
Write the value to this channel. @params chs chunks to be flushed to the channel first
- parameter poll_read
reads to poll regularly on the side
val encode_chunks : ?flags:flags list -> ?pool:IO_chunk.Pool.t -> ?init:IO_chunk.t list -> 'a t -> 'a -> IO_chunk.t list
val decode_bytes : ?off:int -> 'a t -> bytes -> ('a, string) Stdlib.result
val decode_str : 'a t -> string -> ('a, string) Stdlib.result
val decode_chan : ?pool:IO_chunk.Pool.t -> Stdlib.in_channel -> 'a t -> ('a option, string) Stdlib.result
val decode_fd_block : ?pool:IO_chunk.Pool.t -> poll_write:(unit -> Unix.file_descr list) -> Unix.file_descr -> 'a t -> ('a option, string) Stdlib.result
val decode_chunk : IO_chunk.t -> 'a t -> ('a option, string) Stdlib.result
Decode a chunk into at least one
'a
. If it succeeds, returnsOk (Some x)
where part ofchunk
has been consumed. If it needs more input, returnsOk None
and leaveschunk
untouched. Otherwise fails. In case of decoding failure, the state of the chunk is undefined.
val gzip : compress