#[repr(transparent)]pub struct Skill_CEnum(pub u32);
Expand description
Auto-generated FFI type for Skill
.
§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 Skill_CEnum
impl Skill_CEnum
pub const OneHanded: Self
pub const TwoHanded: Self
pub const Archery: Self
pub const Block: Self
pub const Smithing: Self
pub const HeavyArmor: Self
pub const LightArmor: Self
pub const Pickpocket: Self
pub const Lockpicking: Self
pub const Sneak: Self
pub const Alchemy: Self
pub const Speech: Self
pub const Alteration: Self
pub const Conjuration: Self
pub const Destruction: Self
pub const Illusion: Self
pub const Restoration: Self
pub const Enchanting: Self
Sourcepub const fn to_enum(self) -> Option<Skill>
pub const fn to_enum(self) -> Option<Skill>
Converts to the corresponding enum
variant.
Returns Some(Skill)
if the value is valid, otherwise None
.
Trait Implementations§
Source§impl Clone for Skill_CEnum
impl Clone for Skill_CEnum
Source§fn clone(&self) -> Skill_CEnum
fn clone(&self) -> Skill_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 Skill_CEnum
impl Debug for Skill_CEnum
Source§impl Default for Skill_CEnum
impl Default for Skill_CEnum
Source§impl From<Skill> for Skill_CEnum
impl From<Skill> for Skill_CEnum
Source§impl Hash for Skill_CEnum
impl Hash for Skill_CEnum
Source§impl Ord for Skill_CEnum
impl Ord for Skill_CEnum
Source§fn cmp(&self, other: &Skill_CEnum) -> Ordering
fn cmp(&self, other: &Skill_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 Skill_CEnum
impl PartialEq for Skill_CEnum
Source§impl PartialOrd for Skill_CEnum
impl PartialOrd for Skill_CEnum
Source§impl TryFrom<Skill_CEnum> for Skill
impl TryFrom<Skill_CEnum> for Skill
impl Copy for Skill_CEnum
impl Eq for Skill_CEnum
impl StructuralPartialEq for Skill_CEnum
Auto Trait Implementations§
impl Freeze for Skill_CEnum
impl RefUnwindSafe for Skill_CEnum
impl Send for Skill_CEnum
impl Sync for Skill_CEnum
impl Unpin for Skill_CEnum
impl UnwindSafe for Skill_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