Struct ButtonMask
pub struct ButtonMask(/* private fields */);
Implementations§
§impl ButtonMask
impl ButtonMask
pub const M1: ButtonMask = _
pub const M2: ButtonMask = _
pub const M3: ButtonMask = _
pub const M4: ButtonMask = _
pub const M5: ButtonMask = _
pub const ANY: ButtonMask = _
§impl ButtonMask
impl ButtonMask
pub fn contains(self, flag: impl Into<u16>) -> bool
pub fn contains(self, flag: impl Into<u16>) -> bool
Check if this object has all bits set that are also set in flag
.
flag
can be a single enum variant or a whole other mask.
pub fn intersects(self, flag: impl Into<u16>) -> bool
pub fn intersects(self, flag: impl Into<u16>) -> bool
Check if this object has some bits set that are also set in flag
.
flag
can be a single enum variant or a whole other mask.
pub fn remove(self, flags: impl Into<u16>) -> ButtonMask
pub fn remove(self, flags: impl Into<u16>) -> ButtonMask
Remove some flags.
All bits that are set in the given flags are removed from the self
instance, if
they are present.
Trait Implementations§
§impl BitAnd<u16> for ButtonMask
impl BitAnd<u16> for ButtonMask
§impl BitAnd for ButtonMask
impl BitAnd for ButtonMask
§type Output = ButtonMask
type Output = ButtonMask
The resulting type after applying the
&
operator.§fn bitand(self, other: ButtonMask) -> <ButtonMask as BitAnd>::Output
fn bitand(self, other: ButtonMask) -> <ButtonMask as BitAnd>::Output
Performs the
&
operation. Read more§impl BitAndAssign<u16> for ButtonMask
impl BitAndAssign<u16> for ButtonMask
§fn bitand_assign(&mut self, other: u16)
fn bitand_assign(&mut self, other: u16)
Performs the
&=
operation. Read more§impl BitAndAssign for ButtonMask
impl BitAndAssign for ButtonMask
§fn bitand_assign(&mut self, other: ButtonMask)
fn bitand_assign(&mut self, other: ButtonMask)
Performs the
&=
operation. Read more§impl BitOr<u16> for ButtonMask
impl BitOr<u16> for ButtonMask
§impl BitOr for ButtonMask
impl BitOr for ButtonMask
§type Output = ButtonMask
type Output = ButtonMask
The resulting type after applying the
|
operator.§fn bitor(self, other: ButtonMask) -> <ButtonMask as BitOr>::Output
fn bitor(self, other: ButtonMask) -> <ButtonMask as BitOr>::Output
Performs the
|
operation. Read more§impl BitOrAssign<u16> for ButtonMask
impl BitOrAssign<u16> for ButtonMask
§fn bitor_assign(&mut self, other: u16)
fn bitor_assign(&mut self, other: u16)
Performs the
|=
operation. Read more§impl BitOrAssign for ButtonMask
impl BitOrAssign for ButtonMask
§fn bitor_assign(&mut self, other: ButtonMask)
fn bitor_assign(&mut self, other: ButtonMask)
Performs the
|=
operation. Read more§impl Clone for ButtonMask
impl Clone for ButtonMask
§fn clone(&self) -> ButtonMask
fn clone(&self) -> ButtonMask
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for ButtonMask
impl Debug for ButtonMask
§impl Default for ButtonMask
impl Default for ButtonMask
§fn default() -> ButtonMask
fn default() -> ButtonMask
Returns the “default value” for a type. Read more
§impl From<u16> for ButtonMask
impl From<u16> for ButtonMask
§fn from(value: u16) -> ButtonMask
fn from(value: u16) -> ButtonMask
Converts to this type from the input type.
§impl From<u8> for ButtonMask
impl From<u8> for ButtonMask
§fn from(value: u8) -> ButtonMask
fn from(value: u8) -> ButtonMask
Converts to this type from the input type.
§impl Hash for ButtonMask
impl Hash for ButtonMask
§impl Ord for ButtonMask
impl Ord for ButtonMask
§impl PartialEq for ButtonMask
impl PartialEq for ButtonMask
§impl PartialOrd for ButtonMask
impl PartialOrd for ButtonMask
impl Copy for ButtonMask
impl Eq for ButtonMask
impl StructuralPartialEq for ButtonMask
Auto Trait Implementations§
impl Freeze for ButtonMask
impl RefUnwindSafe for ButtonMask
impl Send for ButtonMask
impl Sync for ButtonMask
impl Unpin for ButtonMask
impl UnwindSafe for ButtonMask
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)