[][src]Module destream::de

Stream deserialization framework based on serde::de.

The two most important traits in this module are FromStream and Decoder.

  • A type that implements FromStream is a data structure that can be decoded from any stream encoding supported by destream, and conversely
  • A type that implements Decoder is a data format that can decode any supported stream.

The FromStream trait

destream implements FromStream for many Rust primitive and standard library types. The complete list is below.

Implementations of FromStream provided by destream

  • Primitive types:
    • ()
    • bool
    • i8, i16, i32, i64
    • u8, u16, u32, u64
    • f32, f64
  • Compound types:
    • [T; 0] through [T; 32]
    • tuples up to size 16
  • Common standard library types:
    • String
    • Option<T>
    • PhantomData<T>
  • Collection types:
    • BTreeMap<K, V>
    • BTreeSet<T>
    • BinaryHeap<T>
    • HashMap<K, V, H>
    • HashSet<T, H>
    • LinkedList<T>
    • VecDeque<T>
    • Vec<T>

Traits

Decoder

A data format that can decode a given well-formatted stream using one or more Visitors.

Error

The Error trait allows FromStream implementations to create descriptive error messages belonging to their Decoder context.

Expected

Expected represents an explanation of what data a Visitor was expecting to receive.

FromStream

This trait describes a value which can be decoded from a stream.

MapAccess

Provides a Visitor access to each entry of a map in the input.

SeqAccess

Provides a Visitor access to each element of a sequence in the input.

Visitor

This trait describes a visitor responsible for decoding a stream.