pub enum Integer {
I8,
I16,
I32,
I64,
I128,
}
Expand description
Integers, also used for enum discriminants.
Variants§
Implementations§
Source§impl Integer
impl Integer
pub fn int_ty_str(self) -> &'static str
pub fn uint_ty_str(self) -> &'static str
pub fn size(self) -> Size
Sourcepub fn from_attr<C: HasDataLayout>(cx: &C, ity: IntegerType) -> Integer
pub fn from_attr<C: HasDataLayout>(cx: &C, ity: IntegerType) -> Integer
Gets the Integer type from an IntegerType.
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAndPrefAlign
Sourcepub fn signed_max(self) -> i128
pub fn signed_max(self) -> i128
Returns the largest signed value that can be represented by this Integer.
Sourcepub fn fit_signed(x: i128) -> Integer
pub fn fit_signed(x: i128) -> Integer
Finds the smallest Integer type which can represent the signed value.
Sourcepub fn fit_unsigned(x: u128) -> Integer
pub fn fit_unsigned(x: u128) -> Integer
Finds the smallest Integer type which can represent the unsigned value.
Sourcepub fn for_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Option<Integer>
pub fn for_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Option<Integer>
Finds the smallest integer with the given alignment.
Sourcepub fn approximate_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Integer
pub fn approximate_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Integer
Find the largest integer with the given alignment or less.
pub fn from_size(size: Size) -> Result<Self, String>
Trait Implementations§
Source§impl Ord for Integer
impl Ord for Integer
Source§impl PartialOrd for Integer
impl PartialOrd for Integer
impl Copy for Integer
impl Eq for Integer
impl StructuralPartialEq for Integer
Auto Trait Implementations§
impl Freeze for Integer
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnwindSafe for Integer
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