#[repr(transparent)]pub struct RecordFlag_CEnum(pub u32);
Expand description
Auto-generated FFI type for RecordFlag
.
§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 RecordFlag_CEnum
impl RecordFlag_CEnum
pub const Deleted: Self
pub const Ignored: Self
Sourcepub const fn to_enum(self) -> Option<RecordFlag>
pub const fn to_enum(self) -> Option<RecordFlag>
Converts to the corresponding enum
variant.
Returns Some(RecordFlag)
if the value is valid, otherwise None
.
Sourcepub const fn from_enum(e: RecordFlag) -> Self
pub const fn from_enum(e: RecordFlag) -> Self
Creates the struct from the enum
.
This allows for easy conversion back to the FFI-friendly representation.
Trait Implementations§
Source§impl Clone for RecordFlag_CEnum
impl Clone for RecordFlag_CEnum
Source§fn clone(&self) -> RecordFlag_CEnum
fn clone(&self) -> RecordFlag_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 RecordFlag_CEnum
impl Debug for RecordFlag_CEnum
Source§impl Default for RecordFlag_CEnum
impl Default for RecordFlag_CEnum
Source§impl From<RecordFlag> for RecordFlag_CEnum
impl From<RecordFlag> for RecordFlag_CEnum
Source§fn from(value: RecordFlag) -> Self
fn from(value: RecordFlag) -> Self
Converts to this type from the input type.
Source§impl Hash for RecordFlag_CEnum
impl Hash for RecordFlag_CEnum
Source§impl Ord for RecordFlag_CEnum
impl Ord for RecordFlag_CEnum
Source§fn cmp(&self, other: &RecordFlag_CEnum) -> Ordering
fn cmp(&self, other: &RecordFlag_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 RecordFlag_CEnum
impl PartialEq for RecordFlag_CEnum
Source§impl PartialOrd for RecordFlag_CEnum
impl PartialOrd for RecordFlag_CEnum
Source§impl TryFrom<RecordFlag_CEnum> for RecordFlag
impl TryFrom<RecordFlag_CEnum> for RecordFlag
impl Copy for RecordFlag_CEnum
impl Eq for RecordFlag_CEnum
impl StructuralPartialEq for RecordFlag_CEnum
Auto Trait Implementations§
impl Freeze for RecordFlag_CEnum
impl RefUnwindSafe for RecordFlag_CEnum
impl Send for RecordFlag_CEnum
impl Sync for RecordFlag_CEnum
impl Unpin for RecordFlag_CEnum
impl UnwindSafe for RecordFlag_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