pub struct Buttons(/* private fields */);Expand description
The eight buttons, set where held.
The d-pad occupies the low nibble and the action buttons the high one, which
is the layout GBDK’s J_ constants use.
Implementations§
Source§impl Buttons
impl Buttons
Sourcepub const fn with_right_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_right_checked(self, value: bool) -> Result<Self, ()>
Right on the d-pad.
Bits: 0..1
Sourcepub const fn with_right(self, value: bool) -> Self
pub const fn with_right(self, value: bool) -> Self
Right on the d-pad.
Bits: 0..1
Sourcepub const fn set_right_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_right_checked(&mut self, value: bool) -> Result<(), ()>
Right on the d-pad.
Bits: 0..1
Sourcepub const fn with_left_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_left_checked(self, value: bool) -> Result<Self, ()>
Left on the d-pad.
Bits: 1..2
Sourcepub const fn set_left_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_left_checked(&mut self, value: bool) -> Result<(), ()>
Left on the d-pad.
Bits: 1..2
Sourcepub const fn with_up_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_up_checked(self, value: bool) -> Result<Self, ()>
Up on the d-pad.
Bits: 2..3
Sourcepub const fn set_up_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_up_checked(&mut self, value: bool) -> Result<(), ()>
Up on the d-pad.
Bits: 2..3
Sourcepub const fn with_down_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_down_checked(self, value: bool) -> Result<Self, ()>
Down on the d-pad.
Bits: 3..4
Sourcepub const fn set_down_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_down_checked(&mut self, value: bool) -> Result<(), ()>
Down on the d-pad.
Bits: 3..4
Sourcepub const fn with_a_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_a_checked(self, value: bool) -> Result<Self, ()>
The A button.
Bits: 4..5
Sourcepub const fn with_b_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_b_checked(self, value: bool) -> Result<Self, ()>
The B button.
Bits: 5..6
Sourcepub const fn with_select_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_select_checked(self, value: bool) -> Result<Self, ()>
The Select button.
Bits: 6..7
Sourcepub const fn with_select(self, value: bool) -> Self
pub const fn with_select(self, value: bool) -> Self
The Select button.
Bits: 6..7
Sourcepub const fn set_select(&mut self, value: bool)
pub const fn set_select(&mut self, value: bool)
The Select button.
Bits: 6..7
Sourcepub const fn set_select_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_select_checked(&mut self, value: bool) -> Result<(), ()>
The Select button.
Bits: 6..7
Sourcepub const fn with_start_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_start_checked(self, value: bool) -> Result<Self, ()>
The Start button.
Bits: 7..8
Sourcepub const fn with_start(self, value: bool) -> Self
pub const fn with_start(self, value: bool) -> Self
The Start button.
Bits: 7..8
Trait Implementations§
impl Copy for Buttons
impl Eq for Buttons
impl StructuralPartialEq for Buttons
Auto Trait Implementations§
impl BankSafe for Buttons
impl Freeze 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