Enum passerine::common::opcode::Opcode[][src]

#[repr(u8)]
pub enum Opcode {
Show 19 variants Con, NotInit, Del, FFICall, Copy, Capture, Save, SaveCap, Load, LoadCap, Call, Return, Closure, Print, Label, Tuple, UnData, UnLabel, UnTuple,
}
Expand description

This enum represents a single opcode. Under the hood, it’s just a byte. This allows non opcode bytes to be inserted in bytecode streams.

Variants

Con

Load a constant.

NotInit

Load uninitialized Data.

Del

Delete a value off the stack.

FFICall

Calls out to a Rust function via FFI

Copy

Copies topmost value on the stack.

Capture

Moves a variable onto the heap.

Save

Save a constant into a variable.

SaveCap

Save a value to a captured variable.

Load

Push a copy of a variable onto the stack.

LoadCap

Load a copy of a captured variable.

Call

Call a function.

Return

Return from a function.

Closure

Creates a closure over the current local environment.

Print

Prints a value.

Label

Constructs a label.

Tuple
UnData

Destructures atomic data by asserting it matches exactly.

UnLabel

Destructures a label.

UnTuple

Sestructures a tuple.

Implementations

Convert a raw byte to an opcode. Note that non-opcode bytes should never be interpreted as an opcode. Under the hood, this is just a transmute, so the regular cautions apply. This should never cause a crash and if it does, the vm’s designed to crash hard so it’ll be pretty obvious.

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.