Struct array_map::ArraySet[][src]

#[must_use]
pub struct ArraySet<K, const N: usize> { /* fields omitted */ }
Expand description

A set backed by an array. All possible keys must be known statically.

This set is O(1) for all operations

Implementations

impl<K: Indexable, const N: usize> ArraySet<K, N>[src]

pub fn new() -> Self[src]

Creates a new, empty ArraySet

#[must_use]
pub fn contains(&self, t: K) -> bool
[src]

Determines whether a key already exists in the set

pub fn insert(&mut self, t: K) -> bool[src]

Inserts a key into the set and returns whether it was already contained in the set

pub fn remove(&mut self, t: K) -> bool[src]

Removes a key from the set and returns whether it was already contained in the set

pub fn keys(&self) -> impl Iterator<Item = K> + '_[src]

Returns an iterator over all values that are in the set

#[must_use]
pub fn is_empty(&self) -> bool
[src]

Returns whether this set contains any keys

#[must_use]
pub fn is_full(&self) -> bool
[src]

Returns whether all possible keys are in the set

pub fn empty() -> Self[src]

Creates a new, empty ArraySet

pub fn full() -> Self[src]

Creates a new, full ArraySet

Trait Implementations

impl<K: Indexable, const N: usize> BitAnd<ArraySet<K, N>> for ArraySet<K, N>[src]

type Output = Self

The resulting type after applying the & operator.

fn bitand(self, rhs: Self) -> Self::Output[src]

Performs the & operation. Read more

impl<K: Indexable, const N: usize> BitOr<ArraySet<K, N>> for ArraySet<K, N>[src]

type Output = Self

The resulting type after applying the | operator.

fn bitor(self, rhs: Self) -> Self::Output[src]

Performs the | operation. Read more

impl<K: Indexable, const N: usize> BitXor<ArraySet<K, N>> for ArraySet<K, N>[src]

type Output = Self

The resulting type after applying the ^ operator.

fn bitxor(self, rhs: Self) -> Self::Output[src]

Performs the ^ operation. Read more

impl<K, const N: usize> Clone for ArraySet<K, N>[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<K: Debug + Indexable, const N: usize> Debug for ArraySet<K, N>[src]

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

Formats the value using the given formatter. Read more

impl<K: Indexable, const N: usize> Default for ArraySet<K, N>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'de, K: Deserialize<'de> + Indexable, const N: usize> Deserialize<'de> for ArraySet<K, N>[src]

fn deserialize<D>(
    deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
    D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<K: Indexable, const M: usize, const S: usize> From<&'_ ArrayMap<K, AtomicBool, M>> for ArraySet<K, S>[src]

fn from(m: &ArrayMap<K, AtomicBool, M>) -> Self[src]

Performs the conversion.

impl<K: Indexable, const M: usize, const S: usize> From<ArrayMap<K, bool, M>> for ArraySet<K, S>[src]

fn from(m: ArrayMap<K, bool, M>) -> Self[src]

Performs the conversion.

impl<K: Indexable, const M: usize, const S: usize> From<ArraySet<K, S>> for ArrayMap<K, bool, M>[src]

fn from(s: ArraySet<K, S>) -> Self[src]

Performs the conversion.

impl<K: Indexable, const M: usize, const S: usize> From<ArraySet<K, S>> for ArrayMap<K, AtomicBool, M>[src]

fn from(s: ArraySet<K, S>) -> Self[src]

Performs the conversion.

impl<K: Indexable, const N: usize> FromIterator<K> for ArraySet<K, N>[src]

fn from_iter<I: IntoIterator<Item = K>>(iter: I) -> Self[src]

Creates a value from an iterator. Read more

impl<K: Indexable, const N: usize> Not for ArraySet<K, N>[src]

type Output = Self

The resulting type after applying the ! operator.

fn not(self) -> Self::Output[src]

Performs the unary ! operation. Read more

impl<K, const N: usize> PartialEq<ArraySet<K, N>> for ArraySet<K, N>[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<K: Serialize + Indexable, const N: usize> Serialize for ArraySet<K, N>[src]

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

Serialize this value into the given Serde serializer. Read more

impl<K, const N: usize> Copy for ArraySet<K, N>[src]

impl<K, const N: usize> Eq for ArraySet<K, N>[src]

Auto Trait Implementations

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>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]