pub trait DeserialCtx {
    fn deserial_ctx<R>(
        size_length: SizeLength,
        ensure_ordered: bool,
        source: &mut R
    ) -> Result<Self, ParseError>
    where
        R: Read
; }
Expand description

The DeserialCtx trait provides a means of reading structures from byte-sources (Read) using contextual information. The contextual information is:

  • size_length: The expected number of bytes used for the length of the data.
  • ensure_ordered: Whether the ordering should be ensured, for example that keys in BTreeMap and BTreeSet are in strictly increasing order.

Required Methods

Attempt to read a structure from a given source and context, failing if an error occurs during deserialization or reading.

Implementations on Foreign Types

Deserialization for HashMap given a size_len. Keys are not verified to be in any particular order and setting ensure_ordering have no effect.

Deserialization for HashSet given a size_len. Values are not verified to be in any particular order and setting ensure_ordering have no effect.

Implementors