Struct sawp_flags::Flags [−][src]
Storage type for handling flags
Implementations
impl<Enum> Flags<Enum> where
Enum: Flag,
[src]
Enum: Flag,
pub fn from_flag(flag: Enum) -> Self
[src]
Get a flag from a single enum value
pub fn from_bits(bits: <Enum as Flag>::Primitive) -> Self
[src]
Get a flag from a numeric value
Note: the value is unchecked so any bit may be set. Be
careful because PartialEq
is a direct comparison of
underlying bits.
pub fn bits(&self) -> <Enum as Flag>::Primitive
[src]
Numeric representation of the variant
pub fn bits_ref(&self) -> &<Enum as Flag>::Primitive
[src]
Reference to numeric representation of the variant
pub fn intersects<B: Into<Flags<Enum>>>(self, rhs: B) -> bool
[src]
Check if at least one flag in common is set
pub fn contains<B: Into<Flags<Enum>>>(self, rhs: B) -> bool
[src]
Check if all flags provided in rhs
are set
Trait Implementations
impl<T: Flag> Binary for Flags<T>
[src]
impl<T, B> BitAnd<B> for Flags<T> where
T: Flag,
B: Into<Flags<T>>,
[src]
T: Flag,
B: Into<Flags<T>>,
type Output = Flags<T>
The resulting type after applying the &
operator.
fn bitand(self, other: B) -> Flags<T>
[src]
impl<T, B> BitAndAssign<B> for Flags<T> where
T: Flag,
B: Into<Flags<T>>,
[src]
T: Flag,
B: Into<Flags<T>>,
fn bitand_assign(&mut self, rhs: B)
[src]
impl<T, B> BitOr<B> for Flags<T> where
T: Flag,
B: Into<Flags<T>>,
[src]
T: Flag,
B: Into<Flags<T>>,
type Output = Flags<T>
The resulting type after applying the |
operator.
fn bitor(self, other: B) -> Flags<T>
[src]
impl<T, B> BitOrAssign<B> for Flags<T> where
T: Flag,
B: Into<Flags<T>>,
[src]
T: Flag,
B: Into<Flags<T>>,
fn bitor_assign(&mut self, rhs: B)
[src]
impl<T, B> BitXor<B> for Flags<T> where
T: Flag,
B: Into<Flags<T>>,
[src]
T: Flag,
B: Into<Flags<T>>,
type Output = Flags<T>
The resulting type after applying the ^
operator.
fn bitxor(self, other: B) -> Flags<T>
[src]
impl<T, B> BitXorAssign<B> for Flags<T> where
T: Flag,
B: Into<Flags<T>>,
[src]
T: Flag,
B: Into<Flags<T>>,
fn bitxor_assign(&mut self, rhs: B)
[src]
impl<Enum: Clone, Primitive: Clone> Clone for Flags<Enum, Primitive>
[src]
impl<Enum: Copy, Primitive: Copy> Copy for Flags<Enum, Primitive>
[src]
impl<Enum> Debug for Flags<Enum> where
Enum: Flag,
[src]
Enum: Flag,
impl<Enum> Default for Flags<Enum> where
Enum: Flag,
[src]
Enum: Flag,
impl<T: Flag> Display for Flags<T>
[src]
impl<Enum: Eq, Primitive: Eq> Eq for Flags<Enum, Primitive>
[src]
impl<Enum: Flag> From<Enum> for Flags<Enum>
[src]
impl<T: Flag> Not for Flags<T>
[src]
type Output = Flags<T>
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl<Enum: Flag> PartialEq<Enum> for Flags<Enum>
[src]
impl<Enum: PartialEq, Primitive: PartialEq> PartialEq<Flags<Enum, Primitive>> for Flags<Enum, Primitive>
[src]
fn eq(&self, other: &Flags<Enum, Primitive>) -> bool
[src]
fn ne(&self, other: &Flags<Enum, Primitive>) -> bool
[src]
impl PartialEq<Flags<Test, <Test as Flag>::Primitive>> for Test
[src]
fn eq(&self, other: &Flags<Self>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Enum, Primitive> StructuralEq for Flags<Enum, Primitive>
[src]
impl<Enum, Primitive> StructuralPartialEq for Flags<Enum, Primitive>
[src]
Auto Trait Implementations
impl<Enum, Primitive> RefUnwindSafe for Flags<Enum, Primitive> where
Enum: RefUnwindSafe,
Primitive: RefUnwindSafe,
Enum: RefUnwindSafe,
Primitive: RefUnwindSafe,
impl<Enum, Primitive> Send for Flags<Enum, Primitive> where
Enum: Send,
Primitive: Send,
Enum: Send,
Primitive: Send,
impl<Enum, Primitive> Sync for Flags<Enum, Primitive> where
Enum: Sync,
Primitive: Sync,
Enum: Sync,
Primitive: Sync,
impl<Enum, Primitive> Unpin for Flags<Enum, Primitive> where
Enum: Unpin,
Primitive: Unpin,
Enum: Unpin,
Primitive: Unpin,
impl<Enum, Primitive> UnwindSafe for Flags<Enum, Primitive> where
Enum: UnwindSafe,
Primitive: UnwindSafe,
Enum: UnwindSafe,
Primitive: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,