Struct playdate_rs::system::Buttons
source · #[repr(transparent)]pub struct Buttons { /* private fields */ }Implementations§
source§impl Buttons
impl Buttons
pub const Left: Buttons = _
pub const Right: Buttons = _
pub const Up: Buttons = _
pub const Down: Buttons = _
pub const B: Buttons = _
pub const A: Buttons = _
sourcepub const fn all() -> Self
pub const fn all() -> Self
Returns a bitmask that contains all values.
This will include bits that do not have any flags.
Use ::full() if you only want to use flags.
sourcepub const fn is_all(&self) -> bool
pub const fn is_all(&self) -> bool
Returns true if the bitmask contains all values.
This will check for bits == !0,
use .is_full() if you only want to check for all flags
sourcepub const fn is_full(&self) -> bool
pub const fn is_full(&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 truncate(&self) -> Self
pub const fn truncate(&self) -> Self
Returns a bitmask that only has bits corresponding to flags
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> 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<Buttons> for Buttons
impl BitAndAssign<Buttons> for Buttons
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&= operation. Read moresource§impl BitOrAssign<Buttons> for Buttons
impl BitOrAssign<Buttons> for Buttons
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moresource§impl BitXorAssign<Buttons> for Buttons
impl BitXorAssign<Buttons> for Buttons
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^= operation. Read moresource§impl Ord for Buttons
impl Ord for Buttons
source§impl PartialEq<Buttons> for Buttons
impl PartialEq<Buttons> for Buttons
source§impl PartialOrd<Buttons> for Buttons
impl PartialOrd<Buttons> for Buttons
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for Buttons
impl Eq for Buttons
impl StructuralEq for Buttons
impl StructuralPartialEq for Buttons
Auto Trait Implementations§
impl RefUnwindSafe for Buttons
impl Send for Buttons
impl Sync for Buttons
impl Unpin for Buttons
impl UnwindSafe for Buttons
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