Struct rkyv::collections::hash_set::ArchivedHashSet
source · pub struct ArchivedHashSet<K>(/* private fields */);
Expand description
An archived HashSet
. This is a wrapper around a hash map with the same key and a value of
()
.
Implementations§
source§impl<K> ArchivedHashSet<K>
impl<K> ArchivedHashSet<K>
sourcepub fn get<Q>(&self, k: &Q) -> Option<&K>
pub fn get<Q>(&self, k: &Q) -> Option<&K>
Gets the key corresponding to the given key in the hash set.
sourcepub fn iter(&self) -> Keys<'_, K, ()> ⓘ
pub fn iter(&self) -> Keys<'_, K, ()> ⓘ
Gets an iterator over the keys of the underlying hash map.
sourcepub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: HashSetResolver,
out: *mut Self,
)
pub unsafe fn resolve_from_len( len: usize, pos: usize, resolver: HashSetResolver, out: *mut Self, )
Resolves an archived hash set from the given length and parameters.
§Safety
len
must be the number of elements that were serializedpos
must be the position ofout
within the archiveresolver
must be the result of serializing a hash map
sourcepub unsafe fn serialize_from_iter<'a, KU, S, I>(
iter: I,
serializer: &mut S,
) -> Result<HashSetResolver, S::Error>where
KU: 'a + Serialize<S, Archived = K> + Hash + Eq,
S: Serializer + ScratchSpace + ?Sized,
I: ExactSizeIterator<Item = &'a KU>,
pub unsafe fn serialize_from_iter<'a, KU, S, I>(
iter: I,
serializer: &mut S,
) -> Result<HashSetResolver, S::Error>where
KU: 'a + Serialize<S, Archived = K> + Hash + Eq,
S: Serializer + ScratchSpace + ?Sized,
I: ExactSizeIterator<Item = &'a KU>,
Serializes an iterator of keys as a hash set.
§Safety
The keys returned by the iterator must be unique.
Trait Implementations§
source§impl<K: Debug> Debug for ArchivedHashSet<K>
impl<K: Debug> Debug for ArchivedHashSet<K>
source§impl<K, D, S> Deserialize<HashSet<K, S>, D> for ArchivedHashSet<K::Archived>
impl<K, D, S> Deserialize<HashSet<K, S>, D> for ArchivedHashSet<K::Archived>
source§impl<K, D, S> Deserialize<HashSet<K, S>, D> for ArchivedHashSet<K::Archived>
impl<K, D, S> Deserialize<HashSet<K, S>, D> for ArchivedHashSet<K::Archived>
source§impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<ArchivedHashSet<AK>> for HashSet<K, S>
impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<ArchivedHashSet<AK>> for HashSet<K, S>
source§fn eq(&self, other: &ArchivedHashSet<AK>) -> bool
fn eq(&self, other: &ArchivedHashSet<AK>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<ArchivedHashSet<AK>> for HashSet<K, S>
impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<ArchivedHashSet<AK>> for HashSet<K, S>
source§fn eq(&self, other: &ArchivedHashSet<AK>) -> bool
fn eq(&self, other: &ArchivedHashSet<AK>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S>> for ArchivedHashSet<AK>
impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S>> for ArchivedHashSet<AK>
source§impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S>> for ArchivedHashSet<AK>
impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S>> for ArchivedHashSet<AK>
source§impl<K: Hash + Eq> PartialEq for ArchivedHashSet<K>
impl<K: Hash + Eq> PartialEq for ArchivedHashSet<K>
impl<K: Hash + Eq> Eq for ArchivedHashSet<K>
Auto Trait Implementations§
impl<K> Freeze for ArchivedHashSet<K>
impl<K> RefUnwindSafe for ArchivedHashSet<K>where
K: RefUnwindSafe,
impl<K> Send for ArchivedHashSet<K>where
K: Send,
impl<K> Sync for ArchivedHashSet<K>where
K: Sync,
impl<K> !Unpin for ArchivedHashSet<K>
impl<K> UnwindSafe for ArchivedHashSet<K>where
K: UnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more