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

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

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

impl Opcode[src]

pub fn from_byte(byte: u8) -> Opcode[src]

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

impl Debug for Opcode[src]

impl Eq for Opcode[src]

impl PartialEq<Opcode> for Opcode[src]

impl StructuralEq for Opcode[src]

impl StructuralPartialEq for Opcode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.