# Module Bin_io_utils.Serialized

    module Serialized: sig .. end

    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:

- it will take up less space
- serializing `'a t` is faster (it's just a blit) and it has the same bin-io representation as `'a`.

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.

    val create : 'a Core.Std.Bin_prot.Type_class.writer -> 'a -> 'a t

    val value : 'a t -> 'a Core.Std.Bin_prot.Type_class.reader -> 'a

    val bin_reader_t_with_value : 'a Core.Std.Bin_prot.Type_class.reader ->
           ('a t * 'a) Core.Std.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 Core.Std.Bin_prot.Type_class.t ->
           ('a t * 'a) Core.Std.Bin_prot.Type_class.t

    module Make: functor (B : Core.Std.Binable) -> sig .. end

    val bin_t : 'a Core.Std.Bin_prot.Type_class.t ->
           'a t Core.Std.Bin_prot.Type_class.t

    val bin_read_t : 'a Core.Std.Bin_prot.Read.reader ->
           'a t Core.Std.Bin_prot.Read.reader

    val __bin_read_t__ : 'a Core.Std.Bin_prot.Read.reader ->
           (int -> 'a t) Core.Std.Bin_prot.Read.reader

    val bin_reader_t : 'a Core.Std.Bin_prot.Type_class.reader ->
           'a t Core.Std.Bin_prot.Type_class.reader

    val bin_size_t : 'a Core.Std.Bin_prot.Size.sizer ->
           'a t Core.Std.Bin_prot.Size.sizer

    val bin_write_t : 'a Core.Std.Bin_prot.Write.writer ->
           'a t Core.Std.Bin_prot.Write.writer

    val bin_writer_t : 'a Core.Std.Bin_prot.Type_class.writer ->
           'a t Core.Std.Bin_prot.Type_class.writer

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.