pub enum IntKind {
}
Expand description
Which integral type are we dealing with?
Variants
Bool
A bool
.
SChar
A signed char
.
UChar
An unsigned char
.
WChar
An wchar_t
.
Char
Fields
is_signed: bool
Whether the char is signed for the target platform.
A platform-dependent char
type, with the signedness support.
Short
A short
.
UShort
An unsigned short
.
Int
An int
.
UInt
An unsigned int
.
Long
A long
.
ULong
An unsigned long
.
LongLong
A long long
.
ULongLong
An unsigned long long
.
I8
A 8-bit signed integer.
U8
A 8-bit unsigned integer.
I16
A 16-bit signed integer.
U16
Either a char16_t
or a wchar_t
.
I32
A 32-bit signed integer.
U32
A 32-bit unsigned integer.
I64
A 64-bit signed integer.
U64
A 64-bit unsigned integer.
I128
An int128_t
U128
A uint128_t
.
Custom
Fields
name: &'static str
The name of the type, which would be used without modification.
is_signed: bool
Whether the type is signed or not.
A custom integer type, used to allow custom macro types depending on range.
Implementations
sourceimpl IntKind
impl IntKind
sourcepub fn known_size(&self) -> Option<usize>
pub fn known_size(&self) -> Option<usize>
If this type has a known size, return it (in bytes). This is to alleviate libclang sometimes not giving us a layout (like in the case when an enum is defined inside a class with template parameters).
sourcepub fn signedness_matches(&self, val: i64) -> bool
pub fn signedness_matches(&self, val: i64) -> bool
Whether this type’s signedness matches the value.
Trait Implementations
sourceimpl Ord for IntKind
impl Ord for IntKind
sourceimpl PartialOrd<IntKind> for IntKind
impl PartialOrd<IntKind> for IntKind
sourcefn partial_cmp(&self, other: &IntKind) -> Option<Ordering>
fn partial_cmp(&self, other: &IntKind) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for IntKind
impl Eq for IntKind
impl StructuralEq for IntKind
impl StructuralPartialEq for IntKind
Auto Trait Implementations
impl RefUnwindSafe for IntKind
impl Send for IntKind
impl Sync for IntKind
impl Unpin for IntKind
impl UnwindSafe for IntKind
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more