#[repr(transparent)]pub struct Key_CEnum(pub u32);
Expand description
Auto-generated FFI type for Key
.
§When use this?
C’s enum is really just a number and there is no guarantee that it will fit within the enum. Therefore, it is used for the following cases that cannot be controlled by Rust.
- C++ members
- Function return values.
§When not to use it?
Mainly those that can be controlled for safety on the Rust side.
- Function Arguments
§Convenient methods
to_enum
/from_enum
: To inter-convert enums.count
: Returns the number of defined discriminants.
§Memory Layout
It will always have #[repr(transparent)]
.
In other words, it is equivalent to the size specified in repr
.
Tuple Fields§
§0: u32
Implementations§
Source§impl Key_CEnum
impl Key_CEnum
pub const Up: Self
pub const Down: Self
pub const Left: Self
pub const Right: Self
pub const Start: Self
pub const Back: Self
pub const LeftThumb: Self
pub const RightThumb: Self
pub const LeftShoulder: Self
pub const RightShoulder: Self
pub const A: Self
pub const B: Self
pub const X: Self
pub const Y: Self
pub const LeftTrigger: Self
pub const RightTrigger: Self
pub const LeftStick: Self
pub const RightStick: Self
Sourcepub const fn to_enum(self) -> Option<Key>
pub const fn to_enum(self) -> Option<Key>
Converts to the corresponding enum
variant.
Returns Some(Key)
if the value is valid, otherwise None
.
Trait Implementations§
Source§impl Ord for Key_CEnum
impl Ord for Key_CEnum
Source§impl PartialOrd for Key_CEnum
impl PartialOrd for Key_CEnum
impl Copy for Key_CEnum
impl Eq for Key_CEnum
impl StructuralPartialEq for Key_CEnum
Auto Trait Implementations§
impl Freeze for Key_CEnum
impl RefUnwindSafe for Key_CEnum
impl Send for Key_CEnum
impl Sync for Key_CEnum
impl Unpin for Key_CEnum
impl UnwindSafe for Key_CEnum
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