#[repr(i32)]pub enum GamepadButton {
Show 21 variants
Unknown = 0,
DpadLeft = 1,
DpadRight = 2,
DpadUp = 3,
DpadDown = 4,
South = 5,
East = 6,
North = 7,
West = 8,
ShoulderLeft = 9,
ShoulderRight = 10,
JoystickLeft = 11,
JoystickRight = 12,
Start = 13,
Select = 14,
Logo = 15,
Share = 16,
C = 17,
Z = 18,
TriggerLeft = 19,
TriggerRight = 20,
}
Variants§
Unknown = 0
DpadLeft = 1
DpadRight = 2
DpadUp = 3
DpadDown = 4
South = 5
X on a DualShock/DualSense, A on an Xbox gamepad, and B on a Nintendo gamepad.
East = 6
North = 7
West = 8
ShoulderLeft = 9
The right and left shoulder buttons, usually called L1 and R1.
ShoulderRight = 10
JoystickLeft = 11
The left and right joystick buttons, usually called L3 and R3.
JoystickRight = 12
Start = 13
Assorted buttons on the face of the gamepad.
Select = 14
Logo = 15
C = 17
Occasionally, gamepads will have another two buttons next to the NESW buttons.
Z = 18
TriggerLeft = 19
Very rarely, gamepads will have another set of buttons rather than triggers.
TriggerRight = 20
Implementations§
Source§impl GamepadButton
impl GamepadButton
Source§impl GamepadButton
impl GamepadButton
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<GamepadButton>
pub fn from_str_name(value: &str) -> Option<GamepadButton>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for GamepadButton
impl Clone for GamepadButton
Source§fn clone(&self) -> GamepadButton
fn clone(&self) -> GamepadButton
Returns a copy 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<UT> ConvertError<UT> for GamepadButton
impl<UT> ConvertError<UT> for GamepadButton
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<GamepadButton, Error>
Source§impl Debug for GamepadButton
impl Debug for GamepadButton
Source§impl Default for GamepadButton
impl Default for GamepadButton
Source§fn default() -> GamepadButton
fn default() -> GamepadButton
Returns the “default value” for a type. Read more
Source§impl<UT> FfiConverter<UT> for GamepadButton
impl<UT> FfiConverter<UT> for GamepadButton
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Type ID metadata, serialized into a [MetadataBuffer].
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
The low-level type used for passing values of this type over the FFI. Read more
Source§fn lower(v: GamepadButton) -> RustBuffer
fn lower(v: GamepadButton) -> RustBuffer
Lower a rust value of the target type, into an FFI value of type Self::FfiType. Read more
Source§fn try_lift(buf: RustBuffer) -> Result<GamepadButton, Error>
fn try_lift(buf: RustBuffer) -> Result<GamepadButton, Error>
Lift a rust value of the target type, from an FFI value of type Self::FfiType. Read more
Source§impl Hash for GamepadButton
impl Hash for GamepadButton
Source§impl<UT> Lift<UT> for GamepadButton
impl<UT> Lift<UT> for GamepadButton
type FfiType = <GamepadButton as FfiConverter<UT>>::FfiType
fn try_lift( v: <GamepadButton as Lift<UT>>::FfiType, ) -> Result<GamepadButton, Error>
fn try_read(buf: &mut &[u8]) -> Result<GamepadButton, Error>
§fn try_lift_from_rust_buffer(v: RustBuffer) -> Result<Self, Error>
fn try_lift_from_rust_buffer(v: RustBuffer) -> Result<Self, Error>
Convenience method
Source§impl<UT> LiftRef<UT> for GamepadButton
impl<UT> LiftRef<UT> for GamepadButton
type LiftType = GamepadButton
Source§impl<UT> LiftReturn<UT> for GamepadButton
impl<UT> LiftReturn<UT> for GamepadButton
Source§type ReturnType = <GamepadButton as Lift<UT>>::FfiType
type ReturnType = <GamepadButton as Lift<UT>>::FfiType
FFI return type for trait interfaces
Source§fn try_lift_successful_return(
v: <GamepadButton as LiftReturn<UT>>::ReturnType,
) -> Result<GamepadButton, Error>
fn try_lift_successful_return( v: <GamepadButton as LiftReturn<UT>>::ReturnType, ) -> Result<GamepadButton, Error>
Lift a successfully returned value from a trait interface
§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Lift a foreign returned value from a trait interface Read more
§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Lift a Rust value for a callback interface method error result Read more
§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Lift a Rust value for an unexpected callback interface error Read more
Source§impl<UT> Lower<UT> for GamepadButton
impl<UT> Lower<UT> for GamepadButton
type FfiType = <GamepadButton as FfiConverter<UT>>::FfiType
fn lower(obj: GamepadButton) -> <GamepadButton as Lower<UT>>::FfiType
fn write(obj: GamepadButton, buf: &mut Vec<u8>)
§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Convenience method
Source§impl<UT> LowerError<UT> for GamepadButton
impl<UT> LowerError<UT> for GamepadButton
Source§fn lower_error(obj: GamepadButton) -> RustBuffer
fn lower_error(obj: GamepadButton) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for GamepadButton
impl<UT> LowerReturn<UT> for GamepadButton
Source§type ReturnType = <GamepadButton as Lower<UT>>::FfiType
type ReturnType = <GamepadButton as Lower<UT>>::FfiType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(
v: GamepadButton,
) -> Result<<GamepadButton as LowerReturn<UT>>::ReturnType, RustCallError>
fn lower_return( v: GamepadButton, ) -> Result<<GamepadButton as LowerReturn<UT>>::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl Ord for GamepadButton
impl Ord for GamepadButton
Source§fn cmp(&self, other: &GamepadButton) -> Ordering
fn cmp(&self, other: &GamepadButton) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GamepadButton
impl PartialEq for GamepadButton
Source§impl PartialOrd for GamepadButton
impl PartialOrd for GamepadButton
Source§impl TryFrom<i32> for GamepadButton
impl TryFrom<i32> for GamepadButton
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
The type returned in the event of a conversion error.
Source§fn try_from(value: i32) -> Result<GamepadButton, UnknownEnumValue>
fn try_from(value: i32) -> Result<GamepadButton, UnknownEnumValue>
Performs the conversion.
Source§impl<UT> TypeId<UT> for GamepadButton
impl<UT> TypeId<UT> for GamepadButton
const TYPE_ID_META: MetadataBuffer
impl Copy for GamepadButton
impl Eq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more