Struct sawp_flags::Flags[][src]

#[repr(transparent)]pub struct Flags<Enum, Primitive = <Enum as Flag>::Primitive> { /* fields omitted */ }

Storage type for handling flags

Implementations

impl<Enum> Flags<Enum> where
    Enum: Flag
[src]

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]

type Output = Flags<T>

The resulting type after applying the & operator.

impl<T, B> BitAndAssign<B> for Flags<T> where
    T: Flag,
    B: Into<Flags<T>>, 
[src]

impl<T, B> BitOr<B> for Flags<T> where
    T: Flag,
    B: Into<Flags<T>>, 
[src]

type Output = Flags<T>

The resulting type after applying the | operator.

impl<T, B> BitOrAssign<B> for Flags<T> where
    T: Flag,
    B: Into<Flags<T>>, 
[src]

impl<T, B> BitXor<B> for Flags<T> where
    T: Flag,
    B: Into<Flags<T>>, 
[src]

type Output = Flags<T>

The resulting type after applying the ^ operator.

impl<T, B> BitXorAssign<B> for Flags<T> where
    T: Flag,
    B: Into<Flags<T>>, 
[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]

impl<Enum> Default for Flags<Enum> where
    Enum: Flag
[src]

impl<T: Flag> Display for Flags<T>[src]

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

A pipe-separated list of set flags.

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.

impl<Enum: Flag> PartialEq<Enum> for Flags<Enum>[src]

impl<Enum: PartialEq, Primitive: PartialEq> PartialEq<Flags<Enum, Primitive>> for Flags<Enum, Primitive>[src]

impl PartialEq<Flags<Test, <Test as Flag>::Primitive>> for Test[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

impl<Enum, Primitive> Send for Flags<Enum, Primitive> where
    Enum: Send,
    Primitive: Send

impl<Enum, Primitive> Sync for Flags<Enum, Primitive> where
    Enum: Sync,
    Primitive: Sync

impl<Enum, Primitive> Unpin for Flags<Enum, Primitive> where
    Enum: Unpin,
    Primitive: Unpin

impl<Enum, Primitive> UnwindSafe for Flags<Enum, Primitive> where
    Enum: UnwindSafe,
    Primitive: UnwindSafe

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.