#[repr(transparent)]pub struct Error_CEnum(pub u32);
Expand description
Auto-generated FFI type for Error
.
§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 Error_CEnum
impl Error_CEnum
pub const None: Self
pub const NotFound: Self
pub const NoFile: Self
pub const NoForm: Self
pub const NoChunk: Self
pub const NoID: Self
pub const BadFile: Self
pub const BadID: Self
pub const FormOpen: Self
pub const FileOpen: Self
pub const WriteFailure: Self
pub const InvalidFile: Self
pub const FileInUse: Self
pub const CreateFailure: Self
Sourcepub const fn to_enum(self) -> Option<Error>
pub const fn to_enum(self) -> Option<Error>
Converts to the corresponding enum
variant.
Returns Some(Error)
if the value is valid, otherwise None
.
Trait Implementations§
Source§impl Clone for Error_CEnum
impl Clone for Error_CEnum
Source§fn clone(&self) -> Error_CEnum
fn clone(&self) -> Error_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 Error_CEnum
impl Debug for Error_CEnum
Source§impl Default for Error_CEnum
impl Default for Error_CEnum
Source§impl From<Error> for Error_CEnum
impl From<Error> for Error_CEnum
Source§impl Hash for Error_CEnum
impl Hash for Error_CEnum
Source§impl Ord for Error_CEnum
impl Ord for Error_CEnum
Source§fn cmp(&self, other: &Error_CEnum) -> Ordering
fn cmp(&self, other: &Error_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 Error_CEnum
impl PartialEq for Error_CEnum
Source§impl PartialOrd for Error_CEnum
impl PartialOrd for Error_CEnum
Source§impl TryFrom<Error_CEnum> for Error
impl TryFrom<Error_CEnum> for Error
impl Copy for Error_CEnum
impl Eq for Error_CEnum
impl StructuralPartialEq for Error_CEnum
Auto Trait Implementations§
impl Freeze for Error_CEnum
impl RefUnwindSafe for Error_CEnum
impl Send for Error_CEnum
impl Sync for Error_CEnum
impl Unpin for Error_CEnum
impl UnwindSafe for Error_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