pub enum ButtonState {
Pressed,
Released,
}Expand description
Input vocabulary, defined in crcbl_core::input and re-exported so a
consumer of the event stream needs one use rather than two.
See the crate docs for why these live in crcbl-core.
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) -> ButtonState
pub const fn from_pressed(pressed: bool) -> ButtonState
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl 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