Struct rkyv_test::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<__C: ?Sized, K> CheckBytes<__C> for ArchivedHashSet<K> where
ArchivedHashMap<K, ()>: CheckBytes<__C>,
impl<__C: ?Sized, K> CheckBytes<__C> for ArchivedHashSet<K> where
ArchivedHashMap<K, ()>: CheckBytes<__C>,
type Error = TupleStructCheckError
type Error = TupleStructCheckError
The error that may result from checking the type.
sourceunsafe fn check_bytes<'__bytecheck>(
value: *const Self,
context: &mut __C
) -> Result<&'__bytecheck Self, TupleStructCheckError>
unsafe fn check_bytes<'__bytecheck>(
value: *const Self,
context: &mut __C
) -> Result<&'__bytecheck Self, TupleStructCheckError>
Checks whether the given pointer points to a valid value within the given context. Read more
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>
sourcefn 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 ==
. Read more
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>
sourcefn 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 ==
. Read more
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(
&<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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more