Expand description
Stream deserialization framework with an interface based on serde::de.
The two most important traits in this module are FromStream and Decoder.
- A type that implements
FromStreamis a data structure that can be decoded from any stream encoding supported bydestream, and conversely - A type that implements
Decoderis 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
- Uuid
- Collection types:
- BTreeMap<K, V>
- BTreeSet<T>
- BinaryHeap<T>
- HashMap<K, V, H>
- HashSet<T, H>
- LinkedList<T>
- VecDeque<T>
- Vec<T>
Enable support for SmallVec using the smallvec feature flag.
Structs§
Traits§
- Array
Access - Provides a
Visitorwith access to an array of typeT. - Decoder
- A data format that can decode a given well-formatted stream using one or more
Visitors. - Error
- The
Errortrait allowsFromStreamimplementations to create descriptive error messages belonging to theirDecodercontext. - From
Stream - This trait describes a value which can be decoded from a stream.
- MapAccess
- Provides a
Visitorwith access to each entry of a map in the input. - SeqAccess
- Provides a
Visitoraccess to each element of a sequence in the input. - Visitor
- This trait describes a visitor responsible for decoding a stream.