#[repr(transparent)]pub struct hkResult_CEnum(pub i32);
Expand description
Auto-generated FFI type for hkResult
.
§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: i32
Implementations§
Source§impl hkResult_CEnum
impl hkResult_CEnum
pub const Success: Self
pub const Failure: Self
Sourcepub const fn to_enum(self) -> Option<hkResult>
pub const fn to_enum(self) -> Option<hkResult>
Converts to the corresponding enum
variant.
Returns Some(hkResult)
if the value is valid, otherwise None
.
Trait Implementations§
Source§impl Clone for hkResult_CEnum
impl Clone for hkResult_CEnum
Source§fn clone(&self) -> hkResult_CEnum
fn clone(&self) -> hkResult_CEnum
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 Debug for hkResult_CEnum
impl Debug for hkResult_CEnum
Source§impl Default for hkResult_CEnum
impl Default for hkResult_CEnum
Source§impl From<hkResult> for hkResult_CEnum
impl From<hkResult> for hkResult_CEnum
Source§impl Hash for hkResult_CEnum
impl Hash for hkResult_CEnum
Source§impl Ord for hkResult_CEnum
impl Ord for hkResult_CEnum
Source§fn cmp(&self, other: &hkResult_CEnum) -> Ordering
fn cmp(&self, other: &hkResult_CEnum) -> 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 hkResult_CEnum
impl PartialEq for hkResult_CEnum
Source§impl PartialOrd for hkResult_CEnum
impl PartialOrd for hkResult_CEnum
Source§impl TryFrom<hkResult_CEnum> for hkResult
impl TryFrom<hkResult_CEnum> for hkResult
impl Copy for hkResult_CEnum
impl Eq for hkResult_CEnum
impl StructuralPartialEq for hkResult_CEnum
Auto Trait Implementations§
impl Freeze for hkResult_CEnum
impl RefUnwindSafe for hkResult_CEnum
impl Send for hkResult_CEnum
impl Sync for hkResult_CEnum
impl Unpin for hkResult_CEnum
impl UnwindSafe for hkResult_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