#[repr(u8)]pub enum IntTy {
I8 = 0,
I16 = 1,
I32 = 2,
I64 = 3,
U8 = 4,
U16 = 5,
U32 = 6,
U64 = 7,
}Expand description
An integer type: the width and signedness an integer instruction works at (OPS §1).
§Examples
use bytecode_lang::IntTy;
assert_eq!(IntTy::I64.bits(), 64);
assert!(IntTy::I8.is_signed());
assert!(!IntTy::U32.is_signed());
assert_eq!(IntTy::from_code(3), Some(IntTy::I64));
assert_eq!(IntTy::U16.to_string(), "u16");Variants§
I8 = 0
Signed 8-bit.
I16 = 1
Signed 16-bit.
I32 = 2
Signed 32-bit.
I64 = 3
Signed 64-bit.
U8 = 4
Unsigned 8-bit.
U16 = 5
Unsigned 16-bit.
U32 = 6
Unsigned 32-bit.
U64 = 7
Unsigned 64-bit.
Implementations§
Source§impl IntTy
impl IntTy
Trait Implementations§
impl Copy for IntTy
impl Eq for IntTy
Source§impl Ord for IntTy
impl Ord for IntTy
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for IntTy
impl PartialOrd for IntTy
impl StructuralPartialEq for IntTy
Auto Trait Implementations§
impl Freeze for IntTy
impl RefUnwindSafe for IntTy
impl Send for IntTy
impl Sync for IntTy
impl Unpin for IntTy
impl UnsafeUnpin for IntTy
impl UnwindSafe for IntTy
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