pub struct BitFlags<T: RawBitFlags> { /* private fields */ }Implementations§
Source§impl<T> BitFlags<T>where
T: RawBitFlags,
impl<T> BitFlags<T>where
T: RawBitFlags,
Source§impl<T> BitFlags<T>where
T: RawBitFlags,
impl<T> BitFlags<T>where
T: RawBitFlags,
Sourcepub fn intersects<B: Into<BitFlags<T>>>(self, other: B) -> bool
pub fn intersects<B: Into<BitFlags<T>>>(self, other: B) -> bool
Returns true if at least one flag is shared.
Sourcepub fn contains<B: Into<BitFlags<T>>>(self, other: B) -> bool
pub fn contains<B: Into<BitFlags<T>>>(self, other: B) -> bool
Returns true iff all flags are contained.
Sourcepub fn from_bits(bits: T::Type) -> Option<Self>
pub fn from_bits(bits: T::Type) -> Option<Self>
Returns a BitFlags iff the bits value does not contain any illegal flags.
Sourcepub fn from_bits_truncate(bits: T::Type) -> Self
pub fn from_bits_truncate(bits: T::Type) -> Self
Truncates flags that are illegal
Trait Implementations§
Source§impl<T, B> BitAndAssign<B> for BitFlags<T>
impl<T, B> BitAndAssign<B> for BitFlags<T>
Source§fn bitand_assign(&mut self, other: B)
fn bitand_assign(&mut self, other: B)
Performs the
&= operation. Read moreSource§impl<T, B> BitOrAssign<B> for BitFlags<T>
impl<T, B> BitOrAssign<B> for BitFlags<T>
Source§fn bitor_assign(&mut self, other: B)
fn bitor_assign(&mut self, other: B)
Performs the
|= operation. Read moreSource§impl<T, B> BitXorAssign<B> for BitFlags<T>
impl<T, B> BitXorAssign<B> for BitFlags<T>
Source§fn bitxor_assign(&mut self, other: B)
fn bitxor_assign(&mut self, other: B)
Performs the
^= operation. Read moreSource§impl<T> Debug for BitFlags<T>where
T: RawBitFlags + BitFlagsFmt,
impl<T> Debug for BitFlags<T>where
T: RawBitFlags + BitFlagsFmt,
Source§impl<T: RawBitFlags> From<T> for BitFlags<T>
impl<T: RawBitFlags> From<T> for BitFlags<T>
Source§impl<T, B> FromIterator<B> for BitFlags<T>
impl<T, B> FromIterator<B> for BitFlags<T>
Source§impl<T> Not for BitFlags<T>where
T: RawBitFlags,
impl<T> Not for BitFlags<T>where
T: RawBitFlags,
impl<T: Copy + RawBitFlags> Copy for BitFlags<T>
Auto Trait Implementations§
impl<T> Freeze for BitFlags<T>
impl<T> RefUnwindSafe for BitFlags<T>
impl<T> Send for BitFlags<T>
impl<T> Sync for BitFlags<T>
impl<T> Unpin for BitFlags<T>
impl<T> UnwindSafe for BitFlags<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more