pub struct InlineSparseScalarLookupSet<T, const SZ: usize, const LTSZ: usize, CM = SmallCollection> { /* private fields */ }Expand description
A set whose values are scalars.
This type is an implementation detail of the `frozen_collections` crate.
This API is therefore not stable and may change at any time. Please do not
use this type directly, and instead use the public API provided by the
`frozen_collections` crate.
A frozen collection differs from the traditional Rust collections, such as
[`HashMap`](std::collections::HashMap) and [`HashSet`](std::collections::HashSet) types in three
key ways. First, creating a frozen collection performs an analysis over the input data to
determine the best implementation strategy. Depending on the situation, this analysis is
performed at build time or runtime, and it can take a relatively long time when a collection is
very large. Second, once created, the keys in frozen collections are immutable. And third,
querying a frozen collection is typically considerably faster, which is the whole point.
§Type Parameters
T: The value type.CM: The magnitude of the set, one ofSmallCollection,MediumCollection, orLargeCollection.SZ: The number of entries in the set.LTSZ: The number of entries in the lookup table.
Implementations§
Source§impl<T, const SZ: usize, const LTSZ: usize, CM> InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const LTSZ: usize, CM> InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
Sourcepub const fn new(map: InlineSparseScalarLookupMap<T, (), SZ, LTSZ, CM>) -> Self
pub const fn new(map: InlineSparseScalarLookupMap<T, (), SZ, LTSZ, CM>) -> Self
Creates a frozen set.
Sourcepub fn get<Q>(&self, value: &Q) -> Option<&T>where
Q: Comparable<T> + Scalar,
pub fn get<Q>(&self, value: &Q) -> Option<&T>where
Q: Comparable<T> + Scalar,
Gets a reference to a value in the set.
Trait Implementations§
Source§impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitAnd<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitAnd<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Source§impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitOr<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitOr<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Source§impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitXor<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitXor<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Source§impl<T: Clone, const SZ: usize, const LTSZ: usize, CM: Clone> Clone for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T: Clone, const SZ: usize, const LTSZ: usize, CM: Clone> Clone for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Source§fn clone(&self) -> InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
fn clone(&self) -> InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, const SZ: usize, const LTSZ: usize, CM> Debug for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
T: Debug,
CM: CollectionMagnitude,
impl<T, const SZ: usize, const LTSZ: usize, CM> Debug for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
T: Debug,
CM: CollectionMagnitude,
Source§impl<'a, T, const SZ: usize, const LTSZ: usize, CM> IntoIterator for &'a InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
impl<'a, T, const SZ: usize, const LTSZ: usize, CM> IntoIterator for &'a InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
Source§impl<T, const SZ: usize, const LTSZ: usize, CM> IntoIterator for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const LTSZ: usize, CM> IntoIterator for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
Source§impl<T, const SZ: usize, const LTSZ: usize, CM> Len for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const LTSZ: usize, CM> Len for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
Source§impl<T, ST, const SZ: usize, const LTSZ: usize, CM> PartialEq<ST> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, ST, const SZ: usize, const LTSZ: usize, CM> PartialEq<ST> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Source§impl<T, const SZ: usize, const LTSZ: usize, CM> Serialize for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
T: Serialize,
CM: CollectionMagnitude,
Available on crate feature serde only.
impl<T, const SZ: usize, const LTSZ: usize, CM> Serialize for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
T: Serialize,
CM: CollectionMagnitude,
Available on crate feature
serde only.Source§impl<T, Q, const SZ: usize, const LTSZ: usize, CM> SetExtras<T, Q> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, Q, const SZ: usize, const LTSZ: usize, CM> SetExtras<T, Q> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Source§impl<T, const SZ: usize, const LTSZ: usize, CM> SetIteration<T> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
impl<T, const SZ: usize, const LTSZ: usize, CM> SetIteration<T> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: CollectionMagnitude,
Source§impl<T, Q, const SZ: usize, const LTSZ: usize, CM> SetQuery<Q> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, Q, const SZ: usize, const LTSZ: usize, CM> SetQuery<Q> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Source§impl<T, ST, const SZ: usize, const LTSZ: usize, CM> Sub<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, ST, const SZ: usize, const LTSZ: usize, CM> Sub<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, const SZ: usize, const LTSZ: usize, CM> Eq for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
T: Scalar,
CM: CollectionMagnitude,
impl<T, Q, const SZ: usize, const LTSZ: usize, CM> Set<T, Q> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
Auto Trait Implementations§
impl<T, const SZ: usize, const LTSZ: usize, CM> Freeze for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, const SZ: usize, const LTSZ: usize, CM> RefUnwindSafe for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, const SZ: usize, const LTSZ: usize, CM> Send for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, const SZ: usize, const LTSZ: usize, CM> Sync for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, const SZ: usize, const LTSZ: usize, CM> Unpin for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
impl<T, const SZ: usize, const LTSZ: usize, CM> UnsafeUnpin for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, const SZ: usize, const LTSZ: usize, CM> UnwindSafe for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>where
CM: UnwindSafe,
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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
Compare self to
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> ⓘ
Visits the values representing the union,
i.e., all the values in
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> ⓘ
Visits the values representing the symmetric difference,
i.e., the values that are in
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> ⓘ
Visits the values representing the difference,
i.e., the values that are in
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> ⓘ
Visits the values representing the intersection,
i.e., the values that are both in
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
Returns
true if self has no entries in common with other.
This is equivalent to checking for an empty intersection.