#[repr(u32)]
#[non_exhaustive]
pub enum GamepadButton {
North,
East,
South,
West,
Select,
Mode,
Start,
LeftBumper,
RightBumper,
LeftStick,
RightStick,
}
Expand description
Describes a button of a gamepad controller.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
North
East
South
West
Select
Mode
Start
LeftBumper
RightBumper
LeftStick
RightStick
Trait Implementations
sourceimpl CheckedBitPattern for GamepadButton
impl CheckedBitPattern for GamepadButton
type Bits = u32
type Bits = u32
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
. Read more
sourcefn is_valid_bit_pattern(
bits: &<GamepadButton as CheckedBitPattern>::Bits
) -> bool
fn is_valid_bit_pattern(
bits: &<GamepadButton as CheckedBitPattern>::Bits
) -> bool
If this function returns true, then it must be valid to reinterpret bits
as &Self
. Read more
sourceimpl Clone for GamepadButton
impl Clone for GamepadButton
sourcefn clone(&self) -> GamepadButton
fn clone(&self) -> GamepadButton
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for GamepadButton
impl Debug for GamepadButton
sourceimpl Hash for GamepadButton
impl Hash for GamepadButton
sourceimpl PartialEq<GamepadButton> for GamepadButton
impl PartialEq<GamepadButton> for GamepadButton
sourcefn eq(&self, other: &GamepadButton) -> bool
fn eq(&self, other: &GamepadButton) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl TryFrom<u32> for GamepadButton
impl TryFrom<u32> for GamepadButton
type Error = TryFromPrimitiveError<GamepadButton>
type Error = TryFromPrimitiveError<GamepadButton>
The type returned in the event of a conversion error.
sourcefn try_from(
number: u32
) -> Result<GamepadButton, TryFromPrimitiveError<GamepadButton>>
fn try_from(
number: u32
) -> Result<GamepadButton, TryFromPrimitiveError<GamepadButton>>
Performs the conversion.
sourceimpl TryFromPrimitive for GamepadButton
impl TryFromPrimitive for GamepadButton
type Primitive = u32
const NAME: &'static str = "GamepadButton"
fn try_from_primitive(
number: <GamepadButton as TryFromPrimitive>::Primitive
) -> Result<GamepadButton, TryFromPrimitiveError<GamepadButton>>
impl Copy for GamepadButton
impl Eq for GamepadButton
impl NoUninit for GamepadButton
impl StructuralEq for GamepadButton
impl StructuralPartialEq for GamepadButton
Auto Trait Implementations
impl RefUnwindSafe for GamepadButton
impl Send for GamepadButton
impl Sync for GamepadButton
impl Unpin for GamepadButton
impl UnwindSafe for GamepadButton
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more