Module destream::de [−][src]
Expand description
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 bydestream
, 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, usize
- f32, f64
- Compound types:
- [T; 0] through [T; 32]
- tuples up to size 16
- Common standard library types:
- String
- Option<T>
- PhantomData<T>
- Other common types:
- Bytes
- Collection types:
- BTreeMap<K, V>
- BTreeSet<T>
- BinaryHeap<T>
- HashMap<K, V, H>
- HashSet<T, H>
- LinkedList<T>
- VecDeque<T>
- Vec<T>
Traits
A data format that can decode a given well-formatted stream using one or more Visitor
s.
The Error
trait allows FromStream
implementations to create descriptive
error messages belonging to their Decoder
context.
This trait describes a value which can be decoded from a stream.
Provides a Visitor
access to each entry of a map in the input.
Provides a Visitor
access to each element of a sequence in the input.
This trait describes a visitor responsible for decoding a stream.