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 inBTreeMap
andBTreeSet
are in strictly increasing order.
Required Methods§
sourcefn deserial_ctx<R: Read>(
size_length: SizeLength,
ensure_ordered: bool,
source: &mut R
) -> ParseResult<Self>
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
impl DeserialCtx for String
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>
impl<K: Deserial + Ord> DeserialCtx for BTreeSet<K>
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>
impl<K: Deserial + Ord, V: Deserial> DeserialCtx for BTreeMap<K, V>
fn deserial_ctx<R: Read>( size_len: SizeLength, ensure_ordered: bool, source: &mut R ) -> ParseResult<Self>
source§impl<T: Deserial> DeserialCtx for Vec<T>
impl<T: Deserial> DeserialCtx for Vec<T>
fn deserial_ctx<R: Read>( size_len: SizeLength, _ensure_ordered: bool, source: &mut R ) -> ParseResult<Self>
Implementors§
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.
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.