pub enum Action {
Press,
Release,
}
Expand description
Represents an action that can be taken on a key or button.
The action of pressing the key.
The action of releasing the key.
Creates a new Action
from the given bool
.
- If
is_press
is true
, Action::Press
is returned.
- If
is_press
is false
, Action::Release
is returned.
use winput::Action;
assert_eq!(Action::from_press(true), Action::Press);
assert_eq!(Action::from_press(false), Action::Release);
Creates a new Action
from the given bool
.
- If
is_release
is true
, Action::Release
is returned.
- If
is_release
is false
, Action::Press
is returned.
use winput::Action;
assert_eq!(Action::from_release(true), Action::Release);
assert_eq!(Action::from_release(false), Action::Press);
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
Restrict a value to a certain interval. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.