pub struct ArraySet<K, const N: usize> { /* private fields */ }
Expand description
A set backed by an array. All possible keys must be known statically.
This set is O(1) for all operations
Implementations
sourceimpl<K: Indexable, const N: usize> ArraySet<K, N>
impl<K: Indexable, const N: usize> ArraySet<K, N>
sourcepub fn insert(&mut self, k: K) -> bool
pub fn insert(&mut self, k: K) -> bool
Inserts a key into the set and returns whether it was already contained in the set
sourcepub fn remove(&mut self, k: K) -> bool
pub fn remove(&mut self, k: K) -> bool
Removes a key from the set and returns whether it was already contained in the set
sourcepub fn keys(&self) -> impl Iterator<Item = K> + '_
pub fn keys(&self) -> impl Iterator<Item = K> + '_
Returns an iterator over all values that are in the set
sourcepub fn unset_keys(&self) -> usize
pub fn unset_keys(&self) -> usize
Returns the number of keys that aren’t in the set
sourceimpl<K: ReverseIndexable, const N: usize> ArraySet<K, N>
impl<K: ReverseIndexable, const N: usize> ArraySet<K, N>
sourceimpl<K: Indexable> ArraySet<K, 1>
impl<K: Indexable> ArraySet<K, 1>
sourceimpl<K: Indexable> ArraySet<K, 2>
impl<K: Indexable> ArraySet<K, 2>
sourceimpl<K: Indexable> ArraySet<K, 3>
impl<K: Indexable> ArraySet<K, 3>
sourceimpl<K: Indexable> ArraySet<K, 4>
impl<K: Indexable> ArraySet<K, 4>
sourceimpl<K: Indexable> ArraySet<K, 5>
impl<K: Indexable> ArraySet<K, 5>
sourceimpl<K: Indexable> ArraySet<K, 6>
impl<K: Indexable> ArraySet<K, 6>
sourceimpl<K: Indexable> ArraySet<K, 7>
impl<K: Indexable> ArraySet<K, 7>
Trait Implementations
sourceimpl<K: Indexable, const N: usize> BitAndAssign<ArraySet<K, N>> for ArraySet<K, N>
impl<K: Indexable, const N: usize> BitAndAssign<ArraySet<K, N>> for ArraySet<K, N>
sourcefn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the &=
operation. Read more
sourceimpl<K: Indexable, const N: usize> BitOrAssign<ArraySet<K, N>> for ArraySet<K, N>
impl<K: Indexable, const N: usize> BitOrAssign<ArraySet<K, N>> for ArraySet<K, N>
sourcefn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the |=
operation. Read more
sourceimpl<K: Indexable, const N: usize> BitXorAssign<ArraySet<K, N>> for ArraySet<K, N>
impl<K: Indexable, const N: usize> BitXorAssign<ArraySet<K, N>> for ArraySet<K, N>
sourcefn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the ^=
operation. Read more
sourceimpl<'de, K: Deserialize<'de> + Indexable, const N: usize> Deserialize<'de> for ArraySet<K, N>
impl<'de, K: Deserialize<'de> + Indexable, const N: usize> Deserialize<'de> for ArraySet<K, N>
sourcefn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<K: Indexable, const M: usize, const S: usize> From<&'_ ArrayMap<K, AtomicBool, M>> for ArraySet<K, S>
impl<K: Indexable, const M: usize, const S: usize> From<&'_ ArrayMap<K, AtomicBool, M>> for ArraySet<K, S>
sourcefn from(m: &ArrayMap<K, AtomicBool, M>) -> Self
fn from(m: &ArrayMap<K, AtomicBool, M>) -> Self
Converts to this type from the input type.
sourceimpl<K: Indexable, const M: usize, const S: usize> From<ArrayMap<K, bool, M>> for ArraySet<K, S>
impl<K: Indexable, const M: usize, const S: usize> From<ArrayMap<K, bool, M>> for ArraySet<K, S>
sourceimpl<K: Indexable, const M: usize, const S: usize> From<ArraySet<K, S>> for ArrayMap<K, bool, M>
impl<K: Indexable, const M: usize, const S: usize> From<ArraySet<K, S>> for ArrayMap<K, bool, M>
sourceimpl<K: Indexable, const M: usize, const S: usize> From<ArraySet<K, S>> for ArrayMap<K, AtomicBool, M>
impl<K: Indexable, const M: usize, const S: usize> From<ArraySet<K, S>> for ArrayMap<K, AtomicBool, M>
sourceimpl<K: Indexable, const N: usize> FromIterator<K> for ArraySet<K, N>
impl<K: Indexable, const N: usize> FromIterator<K> for ArraySet<K, N>
sourcefn from_iter<I: IntoIterator<Item = K>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = K>>(iter: I) -> Self
Creates a value from an iterator. Read more
sourceimpl<K: Indexable, const N: usize> IntoIterator for ArraySet<K, N>
impl<K: Indexable, const N: usize> IntoIterator for ArraySet<K, N>
sourceimpl<K: Serialize + Indexable, const N: usize> Serialize for ArraySet<K, N>
impl<K: Serialize + Indexable, const N: usize> Serialize for ArraySet<K, N>
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<K, const N: usize> Copy for ArraySet<K, N>
impl<K, const N: usize> Eq for ArraySet<K, N>
impl<K, const N: usize> Send for ArraySet<K, N>
impl<K, const N: usize> Sync for ArraySet<K, N>
impl<K, const N: usize> Unpin for ArraySet<K, N>
impl<K, const N: usize> UnwindSafe for ArraySet<K, N>
Auto Trait Implementations
impl<K, const N: usize> RefUnwindSafe for ArraySet<K, N> where
K: RefUnwindSafe,
Blanket Implementations
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more