Struct rkyv::collections::hash_set::ArchivedHashSet
source · [−]#[repr(transparent)]pub struct ArchivedHashSet<K>(_);
Expand description
An archived HashSet
. This is a wrapper around a hash map with the same key and a value of
()
.
Implementations
sourceimpl<K> ArchivedHashSet<K>
impl<K> ArchivedHashSet<K>
sourcepub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&K> where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&K> where
K: Borrow<Q>,
Q: Hash + Eq,
Gets the key corresponding to the given key in the hash set.
sourcepub fn contains<Q: ?Sized>(&self, k: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn contains<Q: ?Sized>(&self, k: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
Returns whether the given key is in the hash set.
sourcepub fn iter(&self) -> Keys<'_, K, ()>ⓘNotable traits for Keys<'a, K, V>impl<'a, K, V> Iterator for Keys<'a, K, V> type Item = &'a K;
pub fn iter(&self) -> Keys<'_, K, ()>ⓘNotable traits for Keys<'a, K, V>impl<'a, K, V> Iterator for Keys<'a, K, V> type Item = &'a 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
sourceimpl<K: Debug> Debug for ArchivedHashSet<K>
impl<K: Debug> Debug for ArchivedHashSet<K>
sourceimpl<K, D, S> Deserialize<HashSet<K, S, Global>, D> for ArchivedHashSet<K::Archived> where
K: Archive + Hash + Eq,
K::Archived: Deserialize<K, D> + Hash + Eq,
D: Fallible + ?Sized,
S: Default + BuildHasher,
impl<K, D, S> Deserialize<HashSet<K, S, Global>, D> for ArchivedHashSet<K::Archived> where
K: Archive + Hash + Eq,
K::Archived: Deserialize<K, D> + Hash + Eq,
D: Fallible + ?Sized,
S: Default + BuildHasher,
sourceimpl<K, D, S> Deserialize<HashSet<K, S>, D> for ArchivedHashSet<K::Archived> where
K: Archive + Hash + Eq,
K::Archived: Deserialize<K, D> + Hash + Eq,
D: Fallible + ?Sized,
S: Default + BuildHasher,
impl<K, D, S> Deserialize<HashSet<K, S>, D> for ArchivedHashSet<K::Archived> where
K: Archive + Hash + Eq,
K::Archived: Deserialize<K, D> + Hash + Eq,
D: Fallible + ?Sized,
S: Default + BuildHasher,
sourceimpl<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>
sourceimpl<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>
sourceimpl<K: Hash + Eq> PartialEq<ArchivedHashSet<K>> for ArchivedHashSet<K>
impl<K: Hash + Eq> PartialEq<ArchivedHashSet<K>> for ArchivedHashSet<K>
sourceimpl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S, Global>> for ArchivedHashSet<AK>
impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S, Global>> for ArchivedHashSet<AK>
sourceimpl<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>
impl<K: Hash + Eq> Eq for ArchivedHashSet<K>
Auto Trait Implementations
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
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
fn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more