pub trait DeserialCtx: Sized {
// Required method
fn deserial_ctx<R>(
size_length: SizeLength,
ensure_ordered: bool,
source: &mut R,
) -> Result<Self, ParseError>
where R: Read;
}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 inBTreeMapandBTreeSetare in strictly increasing order.
Required Methods§
Sourcefn deserial_ctx<R>(
size_length: SizeLength,
ensure_ordered: bool,
source: &mut R,
) -> Result<Self, ParseError>where
R: Read,
fn deserial_ctx<R>(
size_length: SizeLength,
ensure_ordered: bool,
source: &mut R,
) -> Result<Self, ParseError>where
R: Read,
Attempt to read a structure from a given source and context, failing if an error occurs during deserialization or reading.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<K, V> DeserialCtx for HashMap<K, V, BuildHasherDefault<FnvHasher>>
Deserialization for HashMap given a size_len.
Keys are not verified to be in any particular order and setting
ensure_ordering have no effect.
impl<K, V> DeserialCtx for HashMap<K, V, BuildHasherDefault<FnvHasher>>
Deserialization for HashMap given a size_len. Keys are not verified to be in any particular order and setting ensure_ordering have no effect.
fn deserial_ctx<R>(
size_len: SizeLength,
_ensure_ordered: bool,
source: &mut R,
) -> Result<HashMap<K, V, BuildHasherDefault<FnvHasher>>, ParseError>where
R: Read,
Source§impl<K> DeserialCtx for HashSet<K, BuildHasherDefault<FnvHasher>>
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> DeserialCtx for HashSet<K, BuildHasherDefault<FnvHasher>>
Deserialization for HashSet given a size_len. Values are not verified to be in any particular order and setting ensure_ordering have no effect.