pub trait DeserialCtx: Sized {
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
fn 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.
Implementations on Foreign Types
sourceimpl<K: Deserial + Ord + Copy> DeserialCtx for BTreeSet<K>
impl<K: Deserial + Ord + Copy> DeserialCtx for BTreeSet<K>
fn deserial_ctx<R: Read>(
size_len: SizeLength,
ensure_ordered: bool,
source: &mut R
) -> ParseResult<Self>
sourceimpl<K: Deserial + Ord + Copy, V: Deserial> DeserialCtx for BTreeMap<K, V>
impl<K: Deserial + Ord + Copy, V: Deserial> DeserialCtx for BTreeMap<K, V>
fn deserial_ctx<R: Read>(
size_len: SizeLength,
ensure_ordered: bool,
source: &mut R
) -> ParseResult<Self>
sourceimpl<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>
sourceimpl DeserialCtx for String
impl DeserialCtx for String
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.