pub trait DeserialCtx: Sized {
    // Required method
    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§

source

fn deserial_ctx<R: Read>( size_length: SizeLength, ensure_ordered: bool, source: &mut R ) -> ParseResult<Self>

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl DeserialCtx for String

source§

fn deserial_ctx<R: Read>( size_len: SizeLength, _ensure_ordered: bool, source: &mut R ) -> ParseResult<Self>

source§

impl<K: Deserial + Ord> DeserialCtx for BTreeSet<K>

source§

fn deserial_ctx<R: Read>( size_len: SizeLength, ensure_ordered: bool, source: &mut R ) -> ParseResult<Self>

source§

impl<K: Deserial + Ord, V: Deserial> DeserialCtx for BTreeMap<K, V>

source§

fn deserial_ctx<R: Read>( size_len: SizeLength, ensure_ordered: bool, source: &mut R ) -> ParseResult<Self>

source§

impl<T: Deserial> DeserialCtx for Vec<T>

source§

fn deserial_ctx<R: Read>( size_len: SizeLength, _ensure_ordered: bool, source: &mut R ) -> ParseResult<Self>

Implementors§

source§

impl<K: Deserial + Eq + Hash> DeserialCtx for HashSet<K>

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

source§

impl<K: Deserial + Eq + Hash, V: Deserial> DeserialCtx for HashMap<K, V>

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