pub struct Leds { /* private fields */ }Expand description
LED mask
Implementations§
Source§impl Leds
impl Leds
Sourcepub const ScrollLock: Leds
pub const ScrollLock: Leds
Scroll lock
Sourcepub const fn all_bits() -> Leds
pub const fn all_bits() -> Leds
Returns a bitmask that contains all values.
This will include bits that do not have any flags.
Use ::all_flags() if you only want to use flags.
Sourcepub const fn is_all_bits(&self) -> bool
pub const fn is_all_bits(&self) -> bool
Returns true if the bitmask contains all values.
This will check for bits == !0,
use .is_all_flags() if you only want to check for all flags
Sourcepub const fn is_all_flags(&self) -> bool
pub const fn is_all_flags(&self) -> bool
Returns true if the bitmask contains all flags.
This will fail if any unused bit is set,
consider using .truncate() first.
Sourcepub const fn all() -> Leds
👎Deprecated: Please use the ::all_bits() constructor
pub const fn all() -> Leds
::all_bits() constructorReturns a bitmask that contains all values.
This will include bits that do not have any flags.
Use ::all_flags() if you only want to use flags.
Sourcepub const fn is_all(&self) -> bool
👎Deprecated: Please use the .is_all_bits() method
pub const fn is_all(&self) -> bool
.is_all_bits() methodReturns true if the bitmask contains all values.
This will check for bits == !0,
use .is_all_flags() if you only want to check for all flags
Sourcepub const fn full() -> Leds
👎Deprecated: Please use the ::all_flags() constructor
pub const fn full() -> Leds
::all_flags() constructorReturns a bitmask that contains all flags.
Sourcepub const fn is_full(&self) -> bool
👎Deprecated: Please use the .is_all_flags() method
pub const fn is_full(&self) -> bool
.is_all_flags() methodReturns true if the bitmask contains all flags.
This will fail if any unused bit is set,
consider using .truncate() first.
Sourcepub const fn truncate(&self) -> Leds
pub const fn truncate(&self) -> Leds
Returns a bitmask that only has bits corresponding to flags
Sourcepub const fn intersects(&self, other: Leds) -> bool
pub const fn intersects(&self, other: Leds) -> bool
Returns true if self intersects with any value in other,
or if other does not contain any values.
This is equivalent to (self & other) != 0 || other == 0.
Trait Implementations§
Source§impl BitAndAssign for Leds
impl BitAndAssign for Leds
Source§fn bitand_assign(&mut self, rhs: Leds)
fn bitand_assign(&mut self, rhs: Leds)
&= operation. Read moreSource§impl BitOrAssign for Leds
impl BitOrAssign for Leds
Source§fn bitor_assign(&mut self, rhs: Leds)
fn bitor_assign(&mut self, rhs: Leds)
|= operation. Read moreSource§impl BitXorAssign for Leds
impl BitXorAssign for Leds
Source§fn bitxor_assign(&mut self, rhs: Leds)
fn bitxor_assign(&mut self, rhs: Leds)
^= operation. Read more