[−][src]Struct enumflags2::BitFlags
Represents a set of flags of some type T
.
Methods
impl<T> BitFlags<T> where
T: RawBitFlags,
[src]
impl<T> BitFlags<T> where
T: RawBitFlags,
pub 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]
impl<T> BitFlags<T> where
T: RawBitFlags,
pub fn empty() -> Self | [src] |
Create an empty BitFlags. Empty means 0
.
pub fn all() -> Self | [src] |
Create a BitFlags with all flags set.
pub fn is_all(self) -> bool | [src] |
Returns true if all flags are set
pub fn is_empty(self) -> bool | [src] |
Returns true if no flag is set
pub fn bits(self) -> T::Type | [src] |
Returns the underlying type value
pub fn intersects<B: Into<BitFlags<T>>>(self, other: B) -> bool | [src] |
Returns true if at least one flag is shared.
pub fn contains<B: Into<BitFlags<T>>>(self, other: B) -> bool | [src] |
Returns true iff all flags are contained.
pub fn not(self) -> Self | [src] |
Flips all flags
pub fn from_bits(bits: T::Type) -> Option<Self> | [src] |
Returns a BitFlags iff the bits value does not contain any illegal flags.
pub fn from_bits_truncate(bits: T::Type) -> Self | [src] |
Truncates flags that are illegal
pub fn toggle<B: Into<BitFlags<T>>>(&mut self, other: B) | [src] |
Toggles the matching bits
pub fn insert<B: Into<BitFlags<T>>>(&mut self, other: B) | [src] |
Inserts the flags into the BitFlag
pub fn remove<B: Into<BitFlags<T>>>(&mut self, other: B) | [src] |
Removes the matching flags
pub fn iter( | [src] |
Returns an iterator that yields each set flag
Trait Implementations
impl<T: RawBitFlags> From<T> for BitFlags<T>
[src]
impl<T: RawBitFlags> From<T> for BitFlags<T>
impl<T> Debug for BitFlags<T> where
T: RawBitFlags + BitFlagsFmt,
[src]
impl<T> Debug for BitFlags<T> where
T: RawBitFlags + BitFlagsFmt,
impl<T, B> PartialEq<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>> + Copy,
[src]
impl<T, B> PartialEq<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>> + Copy,
fn eq(&self, other: &B) -> bool | [src] |
| 1.0.0 [src] |
This method tests for !=
.
impl<T> Not for BitFlags<T> where
T: RawBitFlags,
[src]
impl<T> Not for BitFlags<T> where
T: RawBitFlags,
type Output = BitFlags<T>
The resulting type after applying the !
operator.
fn not(self) -> BitFlags<T> | [src] |
impl<T, B> BitAnd<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
impl<T, B> BitAnd<B> for BitFlags<T> where
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] |
impl<T, B> BitOr<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
impl<T, B> BitOr<B> for BitFlags<T> where
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] |
impl<T, B> BitXor<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
impl<T, B> BitXor<B> for BitFlags<T> where
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] |
impl<T, B> BitAndAssign<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
impl<T, B> BitAndAssign<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
fn bitand_assign(&mut self, other: B) | [src] |
impl<T, B> BitOrAssign<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
impl<T, B> BitOrAssign<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
fn bitor_assign(&mut self, other: B) | [src] |
impl<T, B> BitXorAssign<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
impl<T, B> BitXorAssign<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
fn bitxor_assign(&mut self, other: B) | [src] |
impl<T, B> FromIterator<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
[src]
impl<T, B> FromIterator<B> for BitFlags<T> where
T: RawBitFlags,
B: Into<BitFlags<T>>,
fn from_iter<I>(it: I) -> BitFlags<T> where | [src] |
impl<T: Copy + RawBitFlags> Copy for BitFlags<T> where
T::Type: Copy,
[src]
impl<T: Copy + RawBitFlags> Copy for BitFlags<T> where
T::Type: Copy,
impl<T: Clone + RawBitFlags> Clone for BitFlags<T> where
T::Type: Clone,
[src]
impl<T: Clone + RawBitFlags> Clone for BitFlags<T> where
T::Type: Clone,
Auto Trait Implementations
impl<T> Send for BitFlags<T> where
<T as RawBitFlags>::Type: Send,
impl<T> Send for BitFlags<T> where
<T as RawBitFlags>::Type: Send,
impl<T> Sync for BitFlags<T> where
<T as RawBitFlags>::Type: Sync,
impl<T> Sync for BitFlags<T> where
<T as RawBitFlags>::Type: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,