Trait concordium_std::DeserialCtx[][src]

pub trait DeserialCtx: Sized {
    fn deserial_ctx<R: Read>(
        size_length: SizeLength,
        ensure_ordered: bool,
        source: &mut R
    ) -> ParseResult<Self>; }
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.

Implementors

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

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