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