Type Definition concordium_contracts_common::HashSet
source · [−]pub type HashSet<K, S = FnvBuildHasher> = HashSet<K, S>;
Expand description
Reexport of the HashSet
from hashbrown
with the default hasher set to
the fnv
hash function.
Trait Implementations
sourceimpl<K: Deserial + Hash + Eq> Deserial for HashSet<K>
impl<K: Deserial + Hash + Eq> Deserial for HashSet<K>
The deserialization of sets assumes their size is a u32.
WARNING: Deserialization only ensures that
there are no duplicates. Serializing a HashSet
via its Serial
instance
will not lay out elements in any particular order. As a consequence
deserializing, and serializing back is in general not the identity. This
could have consequences if the data is hashed, or the byte representation
is used in some other way directly. In those cases use a BTreeSet
instead.
sourceimpl<K: Deserial + Eq + Hash> DeserialCtx for HashSet<K>
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.
sourcefn deserial_ctx<R: Read>(
size_len: SizeLength,
_ensure_ordered: bool,
source: &mut R
) -> ParseResult<Self>
fn deserial_ctx<R: Read>(
size_len: 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. Read more
sourceimpl<T: SchemaType> SchemaType for HashSet<T>
impl<T: SchemaType> SchemaType for HashSet<T>
sourceimpl<K: Serial> Serial for HashSet<K>
impl<K: Serial> Serial for HashSet<K>
sufficient for all realistic use cases in smart contracts. They are serialized in no particular order.
sourceimpl<K: Serial> SerialCtx for HashSet<K>
impl<K: Serial> SerialCtx for HashSet<K>
Serialization for HashSet given a size_len. Values are not serialized in any particular order.
sourcefn serial_ctx<W: Write>(
&self,
size_len: SizeLength,
out: &mut W
) -> Result<(), W::Err>
fn serial_ctx<W: Write>(
&self,
size_len: SizeLength,
out: &mut W
) -> Result<(), W::Err>
Attempt to write the structure into the provided writer, failing if
if the length cannot be represented in the provided size_length
or
only part of the structure could be written. Read more