Trait concordium_std::DeserialCtx
source · 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 inBTreeMap
andBTreeSet
are 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.
Implementations on Foreign Types§
source§impl<K, V> DeserialCtx for HashMap<K, V, BuildHasherDefault<FnvHasher>, Global>where
K: Deserial + Eq + Hash,
V: Deserial,
impl<K, V> DeserialCtx for HashMap<K, V, BuildHasherDefault<FnvHasher>, Global>where
K: Deserial + Eq + Hash,
V: Deserial,
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>, Global>, ParseError>where
R: Read,
source§impl<K> DeserialCtx for HashSet<K, BuildHasherDefault<FnvHasher>, Global>where
K: Deserial + Eq + Hash,
impl<K> DeserialCtx for HashSet<K, BuildHasherDefault<FnvHasher>, Global>where
K: Deserial + Eq + Hash,
Deserialization for HashSet given a size_len. Values are not verified to be in any particular order and setting ensure_ordering have no effect.