Enum OpCode

Source
#[repr(u8)]
pub enum OpCode {
Show 74 variants Nop = 0, Exit = 1, Error = 2, Return = 8, Call = 9, InsertArgs = 10, Pop = 16, Drop = 17, DropN = 18, Clone = 19, Tuple = 24, TupleN = 25, IterInit = 26, IterNext = 27, IterUnpack = 28, LoadFunction = 64, LoadFunction16 = 65, LoadConst = 66, LoadConst16 = 67, InsertGlobal = 72, InsertGlobalMut = 73, StoreGlobal = 74, LoadGlobal = 75, InsertLocal = 80, StoreLocal = 81, StoreLocal16 = 82, LoadLocal = 83, LoadLocal16 = 84, DropLocals = 85, StoreUpvalue = 88, StoreUpvalue16 = 89, LoadUpvalue = 90, LoadUpvalue16 = 91, CloseUpvalue = 92, CloseUpvalue16 = 93, Nil = 96, True = 98, False = 97, Empty = 99, UInt8 = 100, Int8 = 101, Int16 = 102, Neg = 112, Pos = 113, Inv = 114, Not = 115, And = 120, Xor = 121, Or = 122, Shl = 123, Shr = 124, Add = 128, Sub = 129, Mul = 130, Div = 131, Mod = 132, EQ = 136, NE = 137, LT = 138, LE = 139, GE = 140, GT = 141, Jump = 144, JumpIfFalse = 145, JumpIfTrue = 146, PopJumpIfFalse = 147, PopJumpIfTrue = 148, LongJump = 152, LongJumpIfFalse = 153, LongJumpIfTrue = 154, PopLongJumpIfFalse = 155, PopLongJumpIfTrue = 156, Inspect = 240, Assert = 241,
}

Variants§

§

Nop = 0

§

Exit = 1

§

Error = 2

§

Return = 8

§

Call = 9

§

InsertArgs = 10

§

Pop = 16

§

Drop = 17

§

DropN = 18

§

Clone = 19

§

Tuple = 24

§

TupleN = 25

§

IterInit = 26

§

IterNext = 27

§

IterUnpack = 28

§

LoadFunction = 64

§

LoadFunction16 = 65

§

LoadConst = 66

§

LoadConst16 = 67

§

InsertGlobal = 72

§

InsertGlobalMut = 73

§

StoreGlobal = 74

§

LoadGlobal = 75

§

InsertLocal = 80

§

StoreLocal = 81

§

StoreLocal16 = 82

§

LoadLocal = 83

§

LoadLocal16 = 84

§

DropLocals = 85

§

StoreUpvalue = 88

§

StoreUpvalue16 = 89

§

LoadUpvalue = 90

§

LoadUpvalue16 = 91

§

CloseUpvalue = 92

§

CloseUpvalue16 = 93

§

Nil = 96

§

True = 98

§

False = 97

§

Empty = 99

§

UInt8 = 100

§

Int8 = 101

§

Int16 = 102

§

Neg = 112

§

Pos = 113

§

Inv = 114

§

Not = 115

§

And = 120

§

Xor = 121

§

Or = 122

§

Shl = 123

§

Shr = 124

§

Add = 128

§

Sub = 129

§

Mul = 130

§

Div = 131

§

Mod = 132

§

EQ = 136

§

NE = 137

§

LT = 138

§

LE = 139

§

GE = 140

§

GT = 141

§

Jump = 144

§

JumpIfFalse = 145

§

JumpIfTrue = 146

§

PopJumpIfFalse = 147

§

PopJumpIfTrue = 148

§

LongJump = 152

§

LongJumpIfFalse = 153

§

LongJumpIfTrue = 154

§

PopLongJumpIfFalse = 155

§

PopLongJumpIfTrue = 156

§

Inspect = 240

§

Assert = 241

Implementations§

Source§

impl OpCode

Source

pub fn from_byte(byte: u8) -> Option<OpCode>

Source

pub const fn instr_len(&self) -> usize

Trait Implementations§

Source§

impl Clone for OpCode

Source§

fn clone(&self) -> OpCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OpCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for OpCode

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<OpCode> for u8

Source§

fn from(opcode: OpCode) -> Self

Converts to this type from the input type.
Source§

impl Hash for OpCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq<u8> for OpCode

Source§

fn eq(&self, other: &u8) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for OpCode

Source§

fn eq(&self, other: &OpCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u8> for OpCode

Source§

type Error = u8

The type returned in the event of a conversion error.
Source§

fn try_from(byte: u8) -> Result<Self, u8>

Performs the conversion.
Source§

impl Copy for OpCode

Source§

impl Eq for OpCode

Source§

impl StructuralPartialEq for OpCode

Auto Trait Implementations§

§

impl Freeze for OpCode

§

impl RefUnwindSafe for OpCode

§

impl Send for OpCode

§

impl Sync for OpCode

§

impl Unpin for OpCode

§

impl UnwindSafe for OpCode

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.