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,
impl<T> EnumSet<T>where
T: EnumSetType,
Sourcepub const fn from_u64_truncated(bits: u64) -> EnumSet<T>
pub const fn from_u64_truncated(bits: u64) -> EnumSet<T>
Build a set from a raw bitmask, discarding bits that name no variant.
Sourcepub fn remove(&mut self, value: T) -> bool
pub fn remove(&mut self, value: T) -> bool
Remove value, returning whether it had been present.
Sourcepub const fn intersection(self, other: EnumSet<T>) -> EnumSet<T>
pub const fn intersection(self, other: EnumSet<T>) -> EnumSet<T>
Variants in both sets.
Sourcepub const fn difference(self, other: EnumSet<T>) -> EnumSet<T>
pub const fn difference(self, other: EnumSet<T>) -> EnumSet<T>
Variants in self but not other.
Sourcepub const fn symmetrical_difference(self, other: EnumSet<T>) -> EnumSet<T>
pub const fn symmetrical_difference(self, other: EnumSet<T>) -> EnumSet<T>
Variants in exactly one of the two sets.
Sourcepub const fn complement(self) -> EnumSet<T>
pub const fn complement(self) -> EnumSet<T>
Every variant not in the set.
Sourcepub const fn is_subset(self, other: EnumSet<T>) -> bool
pub const fn is_subset(self, other: EnumSet<T>) -> bool
Whether every variant of self is in other.
Sourcepub const fn is_superset(self, other: EnumSet<T>) -> bool
pub const fn is_superset(self, other: EnumSet<T>) -> bool
Whether every variant of other is in self.
Sourcepub const fn is_disjoint(self, other: EnumSet<T>) -> bool
pub const fn is_disjoint(self, other: EnumSet<T>) -> bool
Whether the two sets share no variants.
Sourcepub fn iter(self) -> EnumSetIter<T> ⓘ
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,
impl<T> BitAnd for EnumSet<T>where
T: EnumSetType,
Source§impl<T> BitAnd<T> for EnumSet<T>where
T: EnumSetType,
impl<T> BitAnd<T> for EnumSet<T>where
T: EnumSetType,
Source§impl<T> BitAndAssign for EnumSet<T>where
T: EnumSetType,
impl<T> BitAndAssign for EnumSet<T>where
T: EnumSetType,
Source§fn bitand_assign(&mut self, other: EnumSet<T>)
fn bitand_assign(&mut self, other: EnumSet<T>)
Performs the
&= operation. Read moreSource§impl<T> BitAndAssign<T> for EnumSet<T>where
T: EnumSetType,
impl<T> BitAndAssign<T> for EnumSet<T>where
T: EnumSetType,
Source§fn bitand_assign(&mut self, other: T)
fn bitand_assign(&mut self, other: T)
Performs the
&= operation. Read moreSource§impl<T> BitOr for EnumSet<T>where
T: EnumSetType,
impl<T> BitOr for EnumSet<T>where
T: EnumSetType,
Source§impl BitOr<EnumSet<AtomicUsage>> for AtomicUsage
impl BitOr<EnumSet<AtomicUsage>> for AtomicUsage
Source§type Output = EnumSet<AtomicUsage>
type Output = EnumSet<AtomicUsage>
The resulting type after applying the
| operator.Source§fn bitor(self, other: EnumSet<AtomicUsage>) -> EnumSet<AtomicUsage>
fn bitor(self, other: EnumSet<AtomicUsage>) -> EnumSet<AtomicUsage>
Performs the
| operation. Read moreSource§impl BitOr<EnumSet<ComplexUsage>> for ComplexUsage
impl BitOr<EnumSet<ComplexUsage>> for ComplexUsage
Source§type Output = EnumSet<ComplexUsage>
type Output = EnumSet<ComplexUsage>
The resulting type after applying the
| operator.Source§fn bitor(self, other: EnumSet<ComplexUsage>) -> EnumSet<ComplexUsage>
fn bitor(self, other: EnumSet<ComplexUsage>) -> EnumSet<ComplexUsage>
Performs the
| operation. Read moreSource§impl<T> BitOr<T> for EnumSet<T>where
T: EnumSetType,
impl<T> BitOr<T> for EnumSet<T>where
T: EnumSetType,
Source§impl<T> BitOrAssign for EnumSet<T>where
T: EnumSetType,
impl<T> BitOrAssign for EnumSet<T>where
T: EnumSetType,
Source§fn bitor_assign(&mut self, other: EnumSet<T>)
fn bitor_assign(&mut self, other: EnumSet<T>)
Performs the
|= operation. Read moreSource§impl<T> BitOrAssign<T> for EnumSet<T>where
T: EnumSetType,
impl<T> BitOrAssign<T> for EnumSet<T>where
T: EnumSetType,
Source§fn bitor_assign(&mut self, other: T)
fn bitor_assign(&mut self, other: T)
Performs the
|= operation. Read moreSource§impl<T> BitXor for EnumSet<T>where
T: EnumSetType,
impl<T> BitXor for EnumSet<T>where
T: EnumSetType,
Source§impl<T> BitXor<T> for EnumSet<T>where
T: EnumSetType,
impl<T> BitXor<T> for EnumSet<T>where
T: EnumSetType,
Source§impl<T> BitXorAssign for EnumSet<T>where
T: EnumSetType,
impl<T> BitXorAssign for EnumSet<T>where
T: EnumSetType,
Source§fn bitxor_assign(&mut self, other: EnumSet<T>)
fn bitxor_assign(&mut self, other: EnumSet<T>)
Performs the
^= operation. Read moreSource§impl<T> BitXorAssign<T> for EnumSet<T>where
T: EnumSetType,
impl<T> BitXorAssign<T> for EnumSet<T>where
T: EnumSetType,
Source§fn bitxor_assign(&mut self, other: T)
fn bitxor_assign(&mut self, other: T)
Performs the
^= operation. Read moreSource§impl<T> Clone for EnumSet<T>where
T: EnumSetType,
impl<T> Clone for EnumSet<T>where
T: EnumSetType,
impl<T> Copy for EnumSet<T>where
T: EnumSetType,
Source§impl<T> Default for EnumSet<T>where
T: EnumSetType,
impl<T> Default for EnumSet<T>where
T: EnumSetType,
Source§impl<'de, T> Deserialize<'de> for EnumSet<T>where
T: EnumSetType,
Available on crate feature serde only.
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>,
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
impl<T> Eq for EnumSet<T>where
T: EnumSetType,
Source§impl<T> Extend<T> for EnumSet<T>where
T: EnumSetType,
impl<T> Extend<T> for EnumSet<T>where
T: EnumSetType,
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
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)
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)
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,
impl<T> From<T> for EnumSet<T>where
T: EnumSetType,
Source§impl<T> FromIterator<T> for EnumSet<T>where
T: EnumSetType,
impl<T> FromIterator<T> for EnumSet<T>where
T: EnumSetType,
Source§impl<T> Hash for EnumSet<T>where
T: EnumSetType,
impl<T> Hash for EnumSet<T>where
T: EnumSetType,
Source§impl<T> IntoIterator for EnumSet<T>where
T: EnumSetType,
impl<T> IntoIterator for EnumSet<T>where
T: EnumSetType,
Source§impl<T> Not for EnumSet<T>where
T: EnumSetType,
impl<T> Not for EnumSet<T>where
T: EnumSetType,
Source§impl<T> Ord for EnumSet<T>where
T: EnumSetType,
impl<T> Ord for EnumSet<T>where
T: EnumSetType,
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T> PartialEq for EnumSet<T>where
T: EnumSetType,
impl<T> PartialEq for EnumSet<T>where
T: EnumSetType,
Source§impl<T> PartialOrd for EnumSet<T>where
T: EnumSetType,
impl<T> PartialOrd for EnumSet<T>where
T: EnumSetType,
Source§impl<T> Serialize for EnumSet<T>where
T: EnumSetType,
Available on crate feature serde only.
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,
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,
impl<T> Sub for EnumSet<T>where
T: EnumSetType,
Source§impl<T> Sub<T> for EnumSet<T>where
T: EnumSetType,
impl<T> Sub<T> for EnumSet<T>where
T: EnumSetType,
Source§impl<T> SubAssign for EnumSet<T>where
T: EnumSetType,
impl<T> SubAssign for EnumSet<T>where
T: EnumSetType,
Source§fn sub_assign(&mut self, other: EnumSet<T>)
fn sub_assign(&mut self, other: EnumSet<T>)
Performs the
-= operation. Read moreSource§impl<T> SubAssign<T> for EnumSet<T>where
T: EnumSetType,
impl<T> SubAssign<T> for EnumSet<T>where
T: EnumSetType,
Source§fn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
Performs the
-= operation. Read moreAuto Trait Implementations§
impl<T> Freeze for EnumSet<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for EnumSet<T>where
PhantomData<T>: RefUnwindSafe,
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>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for EnumSet<T>where
PhantomData<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<T> CompilationArg for T
impl<T> CompilationArg for T
Source§fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
fn dynamic_cast<Arg>(&self) -> Argwhere
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
impl<T> CubeComptime for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
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>
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)
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)
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
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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