pub struct InlineHashSetNoCollisions<T, const SZ: usize, const NHS: usize, CM = SmallCollection, H = BridgeHasher> { /* private fields */ }Expand description
A general-purpose set implemented using a hash table which doesn’t tolerate hash collisions.
This type requires that the keys
implement the Eq and Hash traits. This can frequently be achieved by
using #[derive(PartialEq, Eq, Hash)]. If you implement these yourself,
it is important that the following property holds:
k1 == k2 -> hash(k1) == hash(k2)In other words, if two keys are equal, their hashes must be equal. Violating this property is a logic error.
It is also a logic error for a key to be modified in such a way that the key’s
hash, as determined by the Hash trait, or its equality, as determined by
the Eq trait, changes while it is in the collection. This is normally only
possible through core::cell::Cell, core::cell::RefCell, global state, I/O,
or unsafe code.
The behavior resulting from either logic error can include panics, incorrect results, memory leaks, and non-termination.
§Type Parameters
T: The value type.CM: The magnitude of the set, one ofSmallCollection,MediumCollection, orLargeCollection.SZ: The number of entries in the set.NHS: The number of hash table slots.H: The hasher to generate hash codes.
Implementations§
Source§impl<T, const SZ: usize, const NHS: usize, CM, H> InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const NHS: usize, CM, H> InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
Sourcepub const fn new(map: InlineHashMapNoCollisions<T, (), SZ, NHS, CM, H>) -> Self
pub const fn new(map: InlineHashMapNoCollisions<T, (), SZ, NHS, CM, H>) -> Self
Creates a frozen set.
Trait Implementations§
Source§impl<T, ST, const SZ: usize, const NHS: usize, CM, H> BitAnd<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, ST, const SZ: usize, const NHS: usize, CM, H> BitAnd<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§impl<T, ST, const SZ: usize, const NHS: usize, CM, H> BitOr<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, ST, const SZ: usize, const NHS: usize, CM, H> BitOr<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§impl<T, ST, const SZ: usize, const NHS: usize, CM, H> BitXor<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, ST, const SZ: usize, const NHS: usize, CM, H> BitXor<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§impl<T: Clone, const SZ: usize, const NHS: usize, CM: Clone, H: Clone> Clone for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T: Clone, const SZ: usize, const NHS: usize, CM: Clone, H: Clone> Clone for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§fn clone(&self) -> InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
fn clone(&self) -> InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T, const SZ: usize, const NHS: usize, CM, H> Debug for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> Debug for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§impl<'a, T, const SZ: usize, const NHS: usize, CM, H> IntoIterator for &'a InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
impl<'a, T, const SZ: usize, const NHS: usize, CM, H> IntoIterator for &'a InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
Source§impl<T, const SZ: usize, const NHS: usize, CM, H> IntoIterator for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const NHS: usize, CM, H> IntoIterator for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
Source§impl<T, const SZ: usize, const NHS: usize, CM, H> Len for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const NHS: usize, CM, H> Len for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
Source§impl<T, ST, const SZ: usize, const NHS: usize, CM, H> PartialEq<ST> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, ST, const SZ: usize, const NHS: usize, CM, H> PartialEq<ST> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§impl<T, const SZ: usize, const NHS: usize, CM, H> Serialize for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
T: Serialize,
CM: CollectionMagnitude,
Available on crate feature serde only.
impl<T, const SZ: usize, const NHS: usize, CM, H> Serialize for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
T: Serialize,
CM: CollectionMagnitude,
serde only.Source§impl<T, Q, const SZ: usize, const NHS: usize, CM, H> SetExtras<T, Q> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, Q, const SZ: usize, const NHS: usize, CM, H> SetExtras<T, Q> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§impl<T, const SZ: usize, const NHS: usize, CM, H> SetIteration<T> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const NHS: usize, CM, H> SetIteration<T> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>where
CM: CollectionMagnitude,
Source§impl<T, Q, const SZ: usize, const NHS: usize, CM, H> SetQuery<Q> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, Q, const SZ: usize, const NHS: usize, CM, H> SetQuery<Q> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Source§impl<T, ST, const SZ: usize, const NHS: usize, CM, H> Sub<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, ST, const SZ: usize, const NHS: usize, CM, H> Sub<&ST> for &InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> Eq for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, Q, const SZ: usize, const NHS: usize, CM, H> Set<T, Q> for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Auto Trait Implementations§
impl<T, const SZ: usize, const NHS: usize, CM, H> Freeze for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> RefUnwindSafe for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> Send for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> Sync for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> Unpin for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> UnsafeUnpin for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
impl<T, const SZ: usize, const NHS: usize, CM, H> UnwindSafe for InlineHashSetNoCollisions<T, SZ, NHS, CM, H>
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<ST, T> SetOps<T> for STwhere
ST: Set<T>,
impl<ST, T> SetOps<T> for STwhere
ST: Set<T>,
Source§fn union<'a, ST>(&'a self, other: &'a ST) -> Union<'a, Self, ST, T> ⓘ
fn union<'a, ST>(&'a self, other: &'a ST) -> Union<'a, Self, ST, T> ⓘ
self or other, without duplicates.Source§fn symmetric_difference<'a, ST>(
&'a self,
other: &'a ST,
) -> SymmetricDifference<'a, Self, ST, T> ⓘ
fn symmetric_difference<'a, ST>( &'a self, other: &'a ST, ) -> SymmetricDifference<'a, Self, ST, T> ⓘ
self or in other but not in both.Source§fn difference<'a, ST>(&'a self, other: &'a ST) -> Difference<'a, Self, ST, T> ⓘ
fn difference<'a, ST>(&'a self, other: &'a ST) -> Difference<'a, Self, ST, T> ⓘ
self but not in other.Source§fn intersection<'a, ST>(
&'a self,
other: &'a ST,
) -> Intersection<'a, Self, ST, T> ⓘ
fn intersection<'a, ST>( &'a self, other: &'a ST, ) -> Intersection<'a, Self, ST, T> ⓘ
self and other. Read moreSource§fn is_disjoint<'a, ST>(&'a self, other: &'a ST) -> bool
fn is_disjoint<'a, ST>(&'a self, other: &'a ST) -> bool
true if self has no entries in common with other.
This is equivalent to checking for an empty intersection.