pub enum ButtonState {
Pressed,
Released,
}Expand description
Whether a two-state input element went down or came up.
One type for keyboard keys, pointer buttons and gamepad buttons: they are
the same fact, and a separate KeyState/MouseState pair only creates
conversion noise at the action layer, which treats all three identically.
Variants§
Implementations§
Source§impl ButtonState
impl ButtonState
Sourcepub const fn is_pressed(self) -> bool
pub const fn is_pressed(self) -> bool
Whether this is ButtonState::Pressed.
Sourcepub const fn from_pressed(pressed: bool) -> Self
pub const fn from_pressed(pressed: bool) -> Self
Trait Implementations§
Source§impl Clone for ButtonState
impl Clone for ButtonState
impl Copy for ButtonState
Source§impl Debug for ButtonState
impl Debug for ButtonState
impl Eq for ButtonState
Source§impl Hash for ButtonState
impl Hash for ButtonState
Source§impl PartialEq for ButtonState
impl PartialEq 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 UnsafeUnpin 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