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>

source

pub const fn len(&self) -> usize

Gets the number of items in the hash set.

source

pub fn get<Q>(&self, k: &Q) -> Option<&K>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Gets the key corresponding to the given key in the hash set.

source

pub fn contains<Q>(&self, k: &Q) -> bool
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns whether the given key is in the hash set.

source

pub fn hasher(&self) -> SeaHasher

Gets the hasher for the underlying hash map.

source

pub const fn is_empty(&self) -> bool

Returns whether there are no items in the hash set.

source

pub fn iter(&self) -> Keys<'_, K, ()>

Gets an iterator over the keys of the underlying hash map.

source

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 serialized
  • pos must be the position of out within the archive
  • resolver must be the result of serializing a hash map
source

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<__C: ?Sized, K> CheckBytes<__C> for ArchivedHashSet<K>
where ArchivedHashMap<K, ()>: CheckBytes<__C>,

§

type Error = TupleStructCheckError

The error that may result from checking the type.
source§

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
source§

impl<K: Debug> Debug for ArchivedHashSet<K>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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,

source§

fn deserialize(&self, deserializer: &mut D) -> Result<HashSet<K, S>, D::Error>

Deserializes using the given deserializer
source§

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,

source§

fn deserialize(&self, deserializer: &mut D) -> Result<HashSet<K, S>, D::Error>

Deserializes using the given deserializer
source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S>> for ArchivedHashSet<AK>

source§

fn eq(&self, other: &HashSet<K, S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: Hash + Eq + Borrow<AK>, AK: Hash + Eq, S: BuildHasher> PartialEq<HashSet<K, S>> for ArchivedHashSet<AK>

source§

fn eq(&self, other: &HashSet<K, S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: Hash + Eq> PartialEq for ArchivedHashSet<K>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.