Struct logitech_lcd_sys::BitFlags
[−]
[src]
pub struct BitFlags<T> where
T: EnumFlagSize, { /* fields omitted */ }
Methods
impl<T> BitFlags<T> where
T: EnumFlagSize,
[src]
T: EnumFlagSize,
unsafe fn new(val: <T as EnumFlagSize>::Size) -> BitFlags<T>
Create a new BitFlags unsafely. Consider using from_bits
or from_bits_truncate
.
impl<T> BitFlags<T> where
T: EnumFlagSize,
<T as EnumFlagSize>::Size: InnerBitFlags,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
[src]
T: EnumFlagSize,
<T as EnumFlagSize>::Size: InnerBitFlags,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
fn empty() -> BitFlags<T>
Create an empty BitFlags. Empty means 0
.
fn all() -> BitFlags<T>
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 as EnumFlagSize>::Size as InnerBitFlags>::Type
Returns the underlying type value
fn intersects<B>(self, other: B) -> bool where
B: Into<BitFlags<T>>,
B: Into<BitFlags<T>>,
Returns true if at least one flag is shared.
fn contains<B>(self, other: B) -> bool where
B: Into<BitFlags<T>>,
B: Into<BitFlags<T>>,
Returns true iff all flags are contained.
fn not(self) -> BitFlags<T>
Flips all flags
fn from_bits(
bits: <<T as EnumFlagSize>::Size as InnerBitFlags>::Type
) -> Option<BitFlags<T>>
bits: <<T as EnumFlagSize>::Size as InnerBitFlags>::Type
) -> Option<BitFlags<T>>
Returns a BitFlags iff the bits value does not contain any illegal flags.
fn from_bits_truncate(
bits: <<T as EnumFlagSize>::Size as InnerBitFlags>::Type
) -> BitFlags<T>
bits: <<T as EnumFlagSize>::Size as InnerBitFlags>::Type
) -> BitFlags<T>
Truncates flags that are illegal
fn toggle(&mut self, other: BitFlags<T>)
fn insert(&mut self, other: BitFlags<T>)
fn remove(&mut self, other: BitFlags<T>)
Trait Implementations
impl<T, B> BitOr<B> for BitFlags<T> where
B: Into<BitFlags<T>>,
T: EnumFlagSize,
<T as EnumFlagSize>::Size: BitOr<<T as EnumFlagSize>::Size>,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as BitOr<<T as EnumFlagSize>::Size>>::Output == <T as EnumFlagSize>::Size,
[src]
B: Into<BitFlags<T>>,
T: EnumFlagSize,
<T as EnumFlagSize>::Size: BitOr<<T as EnumFlagSize>::Size>,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as BitOr<<T as EnumFlagSize>::Size>>::Output == <T as EnumFlagSize>::Size,
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> Copy for BitFlags<T> where
T: EnumFlagSize + Copy,
<T as EnumFlagSize>::Size: Copy,
[src]
T: EnumFlagSize + Copy,
<T as EnumFlagSize>::Size: Copy,
impl<T, B> BitAnd<B> for BitFlags<T> where
B: Into<BitFlags<T>>,
T: EnumFlagSize,
<T as EnumFlagSize>::Size: BitAnd<<T as EnumFlagSize>::Size>,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as BitAnd<<T as EnumFlagSize>::Size>>::Output == <T as EnumFlagSize>::Size,
[src]
B: Into<BitFlags<T>>,
T: EnumFlagSize,
<T as EnumFlagSize>::Size: BitAnd<<T as EnumFlagSize>::Size>,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as BitAnd<<T as EnumFlagSize>::Size>>::Output == <T as EnumFlagSize>::Size,
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
B: Into<BitFlags<T>>,
T: EnumFlagSize,
<T as EnumFlagSize>::Size: BitXor<<T as EnumFlagSize>::Size>,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as BitXor<<T as EnumFlagSize>::Size>>::Output == <T as EnumFlagSize>::Size,
[src]
B: Into<BitFlags<T>>,
T: EnumFlagSize,
<T as EnumFlagSize>::Size: BitXor<<T as EnumFlagSize>::Size>,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as BitXor<<T as EnumFlagSize>::Size>>::Output == <T as EnumFlagSize>::Size,
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> Eq for BitFlags<T> where
T: EnumFlagSize + Eq,
<T as EnumFlagSize>::Size: Eq,
[src]
T: EnumFlagSize + Eq,
<T as EnumFlagSize>::Size: Eq,
impl<T> PartialEq<BitFlags<T>> for BitFlags<T> where
T: EnumFlagSize,
[src]
T: EnumFlagSize,
fn eq(&self, other: &BitFlags<T>) -> 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> Not for BitFlags<T> where
T: EnumFlagSize,
<T as EnumFlagSize>::Size: Not,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as Not>::Output == <T as EnumFlagSize>::Size,
[src]
T: EnumFlagSize,
<T as EnumFlagSize>::Size: Not,
<T as EnumFlagSize>::Size: Into<BitFlags<T>>,
<<T as EnumFlagSize>::Size as Not>::Output == <T as EnumFlagSize>::Size,
type Output = BitFlags<T>
The resulting type after applying the !
operator
fn not(self) -> BitFlags<T>
The method for the unary !
operator
impl<T> Debug for BitFlags<T> where
T: EnumFlagSize,
<T as EnumFlagSize>::Size: Debug,
[src]
T: EnumFlagSize,
<T as EnumFlagSize>::Size: Debug,
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl<T> Clone for BitFlags<T> where
T: EnumFlagSize + Clone,
<T as EnumFlagSize>::Size: Clone,
[src]
T: EnumFlagSize + Clone,
<T as EnumFlagSize>::Size: Clone,
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