pub struct ButtonState { /* private fields */ }
Expand description
Represents the state of a button on the controller.
Implementations§
Source§impl ButtonState
impl ButtonState
Sourcepub const fn is_pressed(&self) -> bool
pub const fn is_pressed(&self) -> bool
Returns true
if this button is currently being pressed.
Sourcepub const fn is_released(&self) -> bool
pub const fn is_released(&self) -> bool
Returns true
if this button is currently released (not being pressed).
Sourcepub const fn is_now_pressed(&self) -> bool
pub const fn is_now_pressed(&self) -> bool
Returns true
if the button state was released in the previous call to Controller::state
, but is now pressed.
Sourcepub const fn is_now_released(&self) -> bool
pub const fn is_now_released(&self) -> bool
Returns true
if the button state was pressed in the previous call to Controller::state
, but is now released.
Trait Implementations§
Source§impl Clone for ButtonState
impl Clone for ButtonState
Source§fn clone(&self) -> ButtonState
fn clone(&self) -> ButtonState
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ButtonState
impl Debug for ButtonState
Source§impl Default for ButtonState
impl Default for ButtonState
Source§fn default() -> ButtonState
fn default() -> ButtonState
Returns the “default value” for a type. Read more
Source§impl PartialEq for ButtonState
impl PartialEq for ButtonState
impl Copy for ButtonState
impl Eq for ButtonState
impl StructuralPartialEq for ButtonState
Auto Trait Implementations§
impl Freeze for ButtonState
impl RefUnwindSafe for ButtonState
impl Send for ButtonState
impl Sync for ButtonState
impl Unpin for ButtonState
impl UnwindSafe for ButtonState
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