#[non_exhaustive]#[repr(u32)]pub enum GamepadButton {
North = 0,
East = 1,
South = 2,
West = 3,
Select = 4,
Mode = 5,
Start = 6,
LeftBumper = 7,
RightBumper = 8,
LeftStick = 9,
RightStick = 10,
}
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 = 0
East = 1
South = 2
West = 3
Select = 4
Mode = 5
Start = 6
LeftBumper = 7
RightBumper = 8
LeftStick = 9
RightStick = 10
Trait Implementations§
Source§impl CheckedBitPattern for GamepadButton
impl CheckedBitPattern for GamepadButton
Source§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
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl Clone for GamepadButton
impl Clone for GamepadButton
Source§fn clone(&self) -> GamepadButton
fn clone(&self) -> GamepadButton
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GamepadButton
impl Debug for GamepadButton
Source§impl From<GamepadButton> for u32
impl From<GamepadButton> for u32
Source§fn from(enum_value: GamepadButton) -> Self
fn from(enum_value: GamepadButton) -> Self
Converts to this type from the input type.
Source§impl Hash for GamepadButton
impl Hash for GamepadButton
Source§impl PartialEq for GamepadButton
impl PartialEq for GamepadButton
Source§impl TryFrom<u32> for GamepadButton
impl TryFrom<u32> for GamepadButton
Source§type Error = TryFromPrimitiveError<GamepadButton>
type Error = TryFromPrimitiveError<GamepadButton>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for GamepadButton
impl TryFromPrimitive for GamepadButton
impl Copy for GamepadButton
impl Eq for GamepadButton
impl NoUninit for GamepadButton
impl StructuralPartialEq for GamepadButton
Auto Trait Implementations§
impl Freeze for GamepadButton
impl RefUnwindSafe for GamepadButton
impl Send for GamepadButton
impl Sync for GamepadButton
impl Unpin for GamepadButton
impl UnwindSafe for GamepadButton
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