#[repr(u8)]pub enum Prim {
Show 14 variants
Bool = 0,
I8 = 1,
I16 = 2,
I32 = 3,
I64 = 4,
U8 = 5,
U16 = 6,
U32 = 7,
U64 = 8,
F32 = 9,
F64 = 10,
Char = 11,
Str = 12,
Ref = 13,
}Expand description
A static representation crossing the dyn boundary: the modifier of
Inst::ToDyn and
Inst::FromDyn.
§Examples
use bytecode_lang::Prim;
assert_eq!(Prim::I64.to_string(), "i64");
assert_eq!(Prim::from_code(13), Some(Prim::Ref));Variants§
Bool = 0
bool.
I8 = 1
i8.
I16 = 2
i16.
I32 = 3
i32.
I64 = 4
i64.
U8 = 5
u8.
U16 = 6
u16.
U32 = 7
u32.
U64 = 8
u64.
F32 = 9
f32.
F64 = 10
f64.
Char = 11
char.
Str = 12
str.
Ref = 13
Any ref type (only to_dyn; from_dyn to a reference is a
checked Cast).
Implementations§
Trait Implementations§
impl Copy for Prim
impl Eq for Prim
Source§impl Ord for Prim
impl Ord for Prim
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 Prim
impl PartialOrd for Prim
impl StructuralPartialEq for Prim
Auto Trait Implementations§
impl Freeze for Prim
impl RefUnwindSafe for Prim
impl Send for Prim
impl Sync for Prim
impl Unpin for Prim
impl UnsafeUnpin for Prim
impl UnwindSafe for Prim
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