Skip to main content

InlineSparseScalarLookupSet

Struct InlineSparseScalarLookupSet 

Source
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

Implementations§

Source§

impl<T, const SZ: usize, const LTSZ: usize, CM> InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source

pub const fn new(map: InlineSparseScalarLookupMap<T, (), SZ, LTSZ, CM>) -> Self

Creates a frozen set.

Source

pub fn get<Q>(&self, value: &Q) -> Option<&T>
where Q: Comparable<T> + Scalar,

Gets a reference to a value in the set.

Source

pub fn contains<Q>(&self, value: &Q) -> bool
where Q: Comparable<T> + Scalar,

Checks whether a particular value is present in the set.

Source

pub fn iter(&self) -> Iter<'_, T>

An iterator visiting all entries in arbitrary order.

Source

pub const fn len(&self) -> usize

Returns the number of elements in the collection.

Source

pub const fn is_empty(&self) -> bool

Returns true if the collection contains no elements.

Trait Implementations§

Source§

impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitAnd<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where T: Scalar + Hash, ST: Set<T>, CM: CollectionMagnitude,

Source§

type Output = HashSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &ST) -> Self::Output

Performs the & operation. Read more
Source§

impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitOr<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where T: Scalar + Hash, ST: Set<T>, CM: CollectionMagnitude,

Source§

type Output = HashSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &ST) -> Self::Output

Performs the | operation. Read more
Source§

impl<T, ST, const SZ: usize, const LTSZ: usize, CM> BitXor<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where T: Scalar + Hash, ST: Set<T>, CM: CollectionMagnitude,

Source§

type Output = HashSet<T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &ST) -> Self::Output

Performs the ^ operation. Read more
Source§

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>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T, const SZ: usize, const LTSZ: usize, CM> Debug for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where T: Debug, CM: CollectionMagnitude,

Source§

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

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

impl<'a, T, const SZ: usize, const LTSZ: usize, CM> IntoIterator for &'a InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T, const SZ: usize, const LTSZ: usize, CM> IntoIterator for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T, const SZ: usize, const LTSZ: usize, CM> Len for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source§

fn len(&self) -> usize

Returns the number of elements in the collection.
Source§

fn is_empty(&self) -> bool

Returns true if the collection contains no elements.
Source§

impl<T, ST, const SZ: usize, const LTSZ: usize, CM> PartialEq<ST> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where T: Scalar, ST: SetQuery<T>, CM: CollectionMagnitude,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, const SZ: usize, const LTSZ: usize, CM> Serialize for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T, Q, const SZ: usize, const LTSZ: usize, CM> SetExtras<T, Q> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source§

fn get(&self, value: &Q) -> Option<&T>

Gets a reference to a value in the set.
Source§

impl<T, const SZ: usize, const LTSZ: usize, CM> SetIteration<T> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source§

type Iterator<'a> = Iter<'a, T> where T: 'a, CM: 'a

The type of the iterator returned by Self::iter.
Source§

fn iter(&self) -> Self::Iterator<'_>

An iterator visiting all entries in arbitrary order.
Source§

impl<T, Q, const SZ: usize, const LTSZ: usize, CM> SetQuery<Q> for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source§

fn contains(&self, value: &Q) -> bool

Checks whether a particular value is present in the set.
Source§

impl<T, ST, const SZ: usize, const LTSZ: usize, CM> Sub<&ST> for &InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where T: Scalar + Hash, ST: Set<T>, CM: CollectionMagnitude,

Source§

type Output = HashSet<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &ST) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const SZ: usize, const LTSZ: usize, CM> Eq for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

Source§

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>
where CM: Freeze, T: Freeze,

§

impl<T, const SZ: usize, const LTSZ: usize, CM> RefUnwindSafe for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>

§

impl<T, const SZ: usize, const LTSZ: usize, CM> Send for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where CM: Send, T: Send,

§

impl<T, const SZ: usize, const LTSZ: usize, CM> Sync for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where CM: Sync, T: Sync,

§

impl<T, const SZ: usize, const LTSZ: usize, CM> Unpin for InlineSparseScalarLookupSet<T, SZ, LTSZ, CM>
where CM: Unpin, T: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<ST, T> SetOps<T> for ST
where ST: Set<T>,

Source§

fn union<'a, ST>(&'a self, other: &'a ST) -> Union<'a, Self, ST, T>
where ST: Set<T>, Self: Sized + Set<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>
where ST: Set<T>, Self: Sized + Set<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>
where ST: Set<T>, Self: Sized + Set<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>
where ST: Set<T>, Self: Sized + Set<T>,

Visits the values representing the intersection, i.e., the values that are both in self and other. Read more
Source§

fn is_disjoint<'a, ST>(&'a self, other: &'a ST) -> bool
where ST: Set<T>, Self: Sized + Set<T>,

Returns true if self has no entries in common with other. This is equivalent to checking for an empty intersection.
Source§

fn is_subset<'a, ST>(&'a self, other: &'a ST) -> bool
where ST: Set<T>, Self: Sized + Set<T>,

Returns true if the set is a subset of another, i.e., other contains at least all the values in self.
Source§

fn is_superset<'a, ST>(&'a self, other: &'a ST) -> bool
where ST: Set<T>, Self: Sized + Set<T>,

Returns true if the set is a superset of another, i.e., self contains at least all the values in other.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.