pub struct Buttons(/* private fields */);Expand description
The set of buttons held down.
Implementations§
Source§impl Buttons
impl Buttons
pub const NONE: Buttons
pub const TRIGGER: Buttons
pub const HOME: Buttons
pub const BACK: Buttons
Sourcepub const TOUCHPAD: Buttons
pub const TOUCHPAD: Buttons
The touchpad pressed down until it clicks (touching alone is reported by Packet::touch).
pub const VOLUME_UP: Buttons
pub const VOLUME_DOWN: Buttons
Sourcepub const fn from_bits(bits: u8) -> Buttons
pub const fn from_bits(bits: u8) -> Buttons
Builds a set from the packet’s button byte, ignoring the non-button bits.
pub const fn bits(self) -> u8
pub const fn is_empty(self) -> bool
Sourcepub const fn pressed_since(self, previous: Buttons) -> Buttons
pub const fn pressed_since(self, previous: Buttons) -> Buttons
Buttons held now that were not held in previous.
pub const fn trigger(self) -> bool
pub const fn home(self) -> bool
pub const fn back(self) -> bool
pub const fn touchpad(self) -> bool
pub const fn volume_up(self) -> bool
pub const fn volume_down(self) -> bool
Trait Implementations§
impl Copy for Buttons
impl Eq for Buttons
impl StructuralPartialEq for Buttons
Auto Trait Implementations§
impl Forget for Buttons
impl Freeze for Buttons
impl Move for Buttons
impl RefUnwindSafe for Buttons
impl Send for Buttons
impl Sync for Buttons
impl Unpin for Buttons
impl UnsafeUnpin 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