Module Core_extended.Bin_io_utils.Serialized

type 'a t

A container for storing an 'a as a bin-io buffer. The advantages of storing a value as an 'a t rather than an 'a are:

However, every time you need to access 'a itself you need to call value, which requires deserializing.

'a t is safe in the sense that you cannot construct an 'a t that doesn't store a valid 'a. When deserializing an 'a, this requires actually constructing 'a. If you'd like access to the 'a that's constructed during deserialization, see the bin_reader_t_with_value below.

include sig ... end
val bin_read_t : 'a Bin_prot.Read.reader ‑> 'a t Bin_prot.Read.reader
val __bin_read_t__ : 'a Bin_prot.Read.reader ‑> (int ‑> 'a t) Bin_prot.Read.reader
val bin_size_t : 'a Bin_prot.Size.sizer ‑> 'a t Bin_prot.Size.sizer
val bin_write_t : 'a Bin_prot.Write.writer ‑> 'a t Bin_prot.Write.writer
val bin_shape_t : Bin_prot.Shape.t ‑> Bin_prot.Shape.t
val create : 'a Bin_prot.Type_class.writer ‑> 'a ‑> 'a t
val value : 'a t ‑> 'a Bin_prot.Type_class.reader ‑> 'a
val bin_reader_t_with_value : 'a Bin_prot.Type_class.reader ‑> ('a t * 'a) Bin_prot.Type_class.reader

Deserializing requires actually constructing an 'a, so this reader gives you access to that 'a, rather than just throwing it away. This is useful because you often might want to do something like indexing 'a t by inspecting 'a at the time that you read it.

val bin_t_with_value : 'a Bin_prot.Type_class.t ‑> ('a t * 'a) Bin_prot.Type_class.t
module Make : functor (B : Core.Binable) -> sig ... end