Skip to main content

EnumSet

Struct EnumSet 

Source
pub struct EnumSet<T>
where T: EnumSetType,
{ /* private fields */ }
Expand description

A set of enum variants, stored as a bitmask.

Implementations§

Source§

impl<T> EnumSet<T>
where T: EnumSetType,

Source

pub const fn empty() -> EnumSet<T>

The empty set.

Source

pub const fn all() -> EnumSet<T>

The set of every variant of T.

Source

pub fn only(value: T) -> EnumSet<T>

A set holding only value.

Source

pub const fn as_u64(self) -> u64

The raw bitmask.

Source

pub const fn from_u64_truncated(bits: u64) -> EnumSet<T>

Build a set from a raw bitmask, discarding bits that name no variant.

Source

pub const fn len(self) -> usize

Number of variants in the set.

Source

pub const fn is_empty(self) -> bool

Whether the set holds no variants.

Source

pub fn contains(self, value: T) -> bool

Whether value is in the set.

Source

pub fn insert(&mut self, value: T) -> bool

Add value, returning whether it was newly added.

Source

pub fn remove(&mut self, value: T) -> bool

Remove value, returning whether it had been present.

Source

pub fn clear(&mut self)

Remove every variant.

Source

pub const fn union(self, other: EnumSet<T>) -> EnumSet<T>

Variants in either set.

Source

pub const fn intersection(self, other: EnumSet<T>) -> EnumSet<T>

Variants in both sets.

Source

pub const fn difference(self, other: EnumSet<T>) -> EnumSet<T>

Variants in self but not other.

Source

pub const fn symmetrical_difference(self, other: EnumSet<T>) -> EnumSet<T>

Variants in exactly one of the two sets.

Source

pub const fn complement(self) -> EnumSet<T>

Every variant not in the set.

Source

pub const fn is_subset(self, other: EnumSet<T>) -> bool

Whether every variant of self is in other.

Source

pub const fn is_superset(self, other: EnumSet<T>) -> bool

Whether every variant of other is in self.

Source

pub const fn is_disjoint(self, other: EnumSet<T>) -> bool

Whether the two sets share no variants.

Source

pub fn iter(self) -> EnumSetIter<T> ⓘ

Iterate the variants in the set, in declaration order.

Trait Implementations§

Source§

impl<T> BitAnd for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: EnumSet<T>) -> EnumSet<T>

Performs the & operation. Read more
Source§

impl<T> BitAnd<T> for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: T) -> EnumSet<T>

Performs the & operation. Read more
Source§

impl<T> BitAndAssign for EnumSet<T>
where T: EnumSetType,

Source§

fn bitand_assign(&mut self, other: EnumSet<T>)

Performs the &= operation. Read more
Source§

impl<T> BitAndAssign<T> for EnumSet<T>
where T: EnumSetType,

Source§

fn bitand_assign(&mut self, other: T)

Performs the &= operation. Read more
Source§

impl<T> BitOr for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<T>) -> EnumSet<T>

Performs the | operation. Read more
Source§

impl BitOr<EnumSet<AtomicUsage>> for AtomicUsage

Source§

type Output = EnumSet<AtomicUsage>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<AtomicUsage>) -> EnumSet<AtomicUsage>

Performs the | operation. Read more
Source§

impl BitOr<EnumSet<ComplexUsage>> for ComplexUsage

Source§

type Output = EnumSet<ComplexUsage>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<ComplexUsage>) -> EnumSet<ComplexUsage>

Performs the | operation. Read more
Source§

impl BitOr<EnumSet<FastMath>> for FastMath

Source§

type Output = EnumSet<FastMath>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<FastMath>) -> EnumSet<FastMath>

Performs the | operation. Read more
Source§

impl BitOr<EnumSet<Fp8Format>> for Fp8Format

Source§

type Output = EnumSet<Fp8Format>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<Fp8Format>) -> EnumSet<Fp8Format>

Performs the | operation. Read more
Source§

impl BitOr<EnumSet<Plane>> for Plane

Source§

type Output = EnumSet<Plane>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<Plane>) -> EnumSet<Plane>

Performs the | operation. Read more
Source§

impl BitOr<EnumSet<Tma>> for Tma

Source§

type Output = EnumSet<Tma>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<Tma>) -> EnumSet<Tma>

Performs the | operation. Read more
Source§

impl BitOr<EnumSet<TypeUsage>> for TypeUsage

Source§

type Output = EnumSet<TypeUsage>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: EnumSet<TypeUsage>) -> EnumSet<TypeUsage>

Performs the | operation. Read more
Source§

impl<T> BitOr<T> for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: T) -> EnumSet<T>

Performs the | operation. Read more
Source§

impl<T> BitOrAssign for EnumSet<T>
where T: EnumSetType,

Source§

fn bitor_assign(&mut self, other: EnumSet<T>)

Performs the |= operation. Read more
Source§

impl<T> BitOrAssign<T> for EnumSet<T>
where T: EnumSetType,

Source§

fn bitor_assign(&mut self, other: T)

Performs the |= operation. Read more
Source§

impl<T> BitXor for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: EnumSet<T>) -> EnumSet<T>

Performs the ^ operation. Read more
Source§

impl<T> BitXor<T> for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: T) -> EnumSet<T>

Performs the ^ operation. Read more
Source§

impl<T> BitXorAssign for EnumSet<T>
where T: EnumSetType,

Source§

fn bitxor_assign(&mut self, other: EnumSet<T>)

Performs the ^= operation. Read more
Source§

impl<T> BitXorAssign<T> for EnumSet<T>
where T: EnumSetType,

Source§

fn bitxor_assign(&mut self, other: T)

Performs the ^= operation. Read more
Source§

impl<T> Clone for EnumSet<T>
where T: EnumSetType,

Source§

fn clone(&self) -> EnumSet<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for EnumSet<T>
where T: EnumSetType,

Source§

impl<T> Debug for EnumSet<T>
where T: EnumSetType + Debug,

Source§

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

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

impl<T> Default for EnumSet<T>
where T: EnumSetType,

Source§

fn default() -> EnumSet<T>

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

impl<'de, T> Deserialize<'de> for EnumSet<T>
where T: EnumSetType,

Available on crate feature serde only.
Source§

fn deserialize<D>( deserializer: D, ) -> Result<EnumSet<T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> Eq for EnumSet<T>
where T: EnumSetType,

Source§

impl<T> Extend<T> for EnumSet<T>
where T: EnumSetType,

Source§

fn extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<T> From<T> for EnumSet<T>
where T: EnumSetType,

Source§

fn from(value: T) -> EnumSet<T>

Converts to this type from the input type.
Source§

impl<T> FromIterator<T> for EnumSet<T>
where T: EnumSetType,

Source§

fn from_iter<I>(iter: I) -> EnumSet<T>
where I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
Source§

impl<T> Hash for EnumSet<T>
where T: EnumSetType,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> IntoIterator for EnumSet<T>
where T: EnumSetType,

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = EnumSetIter<T>

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

fn into_iter(self) -> <EnumSet<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> Not for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the ! operator.
Source§

fn not(self) -> EnumSet<T>

Performs the unary ! operation using logical or bitwise negation. Read more
Source§

impl<T> Ord for EnumSet<T>
where T: EnumSetType,

Source§

fn cmp(&self, other: &EnumSet<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl<T> PartialEq for EnumSet<T>
where T: EnumSetType,

Source§

fn eq(&self, other: &EnumSet<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<T> PartialOrd for EnumSet<T>
where T: EnumSetType,

Source§

fn partial_cmp(&self, other: &EnumSet<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Serialize for EnumSet<T>
where T: EnumSetType,

Available on crate feature serde only.
Source§

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
Source§

impl<T> Sub for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: EnumSet<T>) -> EnumSet<T>

Performs the - operation. Read more
Source§

impl<T> Sub<T> for EnumSet<T>
where T: EnumSetType,

Source§

type Output = EnumSet<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: T) -> EnumSet<T>

Performs the - operation. Read more
Source§

impl<T> SubAssign for EnumSet<T>
where T: EnumSetType,

Source§

fn sub_assign(&mut self, other: EnumSet<T>)

Performs the -= operation. Read more
Source§

impl<T> SubAssign<T> for EnumSet<T>
where T: EnumSetType,

Source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
Source§

impl<T> TypeHash for EnumSet<T>
where T: TypeHash + EnumSetType,

Source§

fn write_hash(hasher: &mut impl Hasher)

Write the structure of the type to the hasher
Source§

fn type_hash() -> u128

Generate a stable hash of the type structure. Read more

Auto Trait Implementations§

§

impl<T> Freeze for EnumSet<T>
where PhantomData<T>: Freeze,

§

impl<T> RefUnwindSafe for EnumSet<T>

§

impl<T> Send for EnumSet<T>
where PhantomData<T>: Send,

§

impl<T> Sync for EnumSet<T>
where PhantomData<T>: Sync,

§

impl<T> Unpin for EnumSet<T>
where PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for EnumSet<T>

§

impl<T> UnwindSafe for EnumSet<T>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<K, Q> Comparable<Q> for K
where K: Borrow<Q> + ?Sized, Q: Ord + ?Sized,

Source§

fn compare(&self, key: &Q) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> CompilationArg for T
where T: Clone + PartialEq + Eq + Hash + Debug + Send + Sync + 'static,

Source§

fn dynamic_cast<Arg>(&self) -> Arg
where Arg: CompilationArg,

Compilation args should be the same even with different element types. However, it isn’t possible to enforce it with the type system. So, we make the compilation args serializable and dynamically cast them. Read more
Source§

impl<T> CubeComptime for T
where T: Debug + Hash + Eq + Clone + Copy,

Source§

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

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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<K, Q> Equivalent<Q> for K
where K: Borrow<Q> + ?Sized, Q: Eq + ?Sized,

Source§

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

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StoreKey for T

Source§

impl<T> StoreValue for T

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> TuneInputs for T
where T: Clone + Send + Sync + 'static,

Source§

type At<'a> = T

The concrete input type at lifetime 'a.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more