Struct enumflags::BitFlags
[−]
[src]
pub struct BitFlags<T: RawBitFlags> { /* fields omitted */ }
Methods
impl<T> BitFlags<T> where
T: RawBitFlags,
[src]
T: RawBitFlags,
unsafe fn new(val: T::Type) -> Self
[src]
Create a new BitFlags unsafely. Consider using from_bits
or from_bits_truncate
.
impl<T> BitFlags<T> where
T: RawBitFlags,
[src]
T: RawBitFlags,
fn empty() -> Self
[src]
Create an empty BitFlags. Empty means 0
.
fn all() -> Self
[src]
Sets all flags.
fn is_all(self) -> bool
[src]
Returns true if all flags are set
fn is_empty(self) -> bool
[src]
Returns true if no flag is set
fn bits(self) -> T::Type
[src]
Returns the underlying type value
fn intersects<B: Into<BitFlags<T>>>(self, other: B) -> bool
[src]
Returns true if at least one flag is shared.
fn contains<B: Into<BitFlags<T>>>(self, other: B) -> bool
[src]
Returns true iff all flags are contained.
fn not(self) -> Self
[src]
Flips all flags
fn from_bits(bits: T::Type) -> Option<Self>
[src]
Returns a BitFlags iff the bits value does not contain any illegal flags.
fn from_bits_truncate(bits: T::Type) -> Self
[src]
Truncates flags that are illegal
fn toggle<B: Into<BitFlags<T>>>(&mut self, other: B)
[src]
Toggles the matching bits
fn insert<B: Into<BitFlags<T>>>(&mut self, other: B)
[src]
Inserts the flags into the BitFlag
fn remove<B: Into<BitFlags<T>>>(&mut self, other: B)
[src]
Removes the matching flags
Trait Implementations
impl<T: Copy + RawBitFlags> Copy for BitFlags<T> where
T::Type: Copy,
[src]
T::Type: Copy,
impl<T: Clone + RawBitFlags> Clone for BitFlags<T> where
T::Type: Clone,
[src]
T::Type: Clone,
fn clone(&self) -> BitFlags<T>
[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<T> Debug for BitFlags<T> where
T: RawBitFlags + BitFlagsFmt,
[src]
T: RawBitFlags + BitFlagsFmt,
impl<T: RawBitFlags> From<T> for BitFlags<T>
[src]
impl<T, B> PartialEq<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>> + Copy,
[src]
T: RawBitFlags,
B: Into<BitFlags<T>> + Copy,
fn eq(&self, other: &B) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T, B> BitOr<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
T: RawBitFlags,
B: Into<BitFlags<T>>,
type Output = BitFlags<T>
The resulting type after applying the |
operator.
fn bitor(self, other: B) -> BitFlags<T>
[src]
Performs the |
operation.
impl<T, B> BitAnd<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
T: RawBitFlags,
B: Into<BitFlags<T>>,
type Output = BitFlags<T>
The resulting type after applying the &
operator.
fn bitand(self, other: B) -> BitFlags<T>
[src]
Performs the &
operation.
impl<T, B> BitXor<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
T: RawBitFlags,
B: Into<BitFlags<T>>,
type Output = BitFlags<T>
The resulting type after applying the ^
operator.
fn bitxor(self, other: B) -> BitFlags<T>
[src]
Performs the ^
operation.
impl<T> Not for BitFlags<T> where
T: RawBitFlags,
[src]
T: RawBitFlags,