[][src]Struct stack_vm::InstructionTable

pub struct InstructionTable<T: Debug>(_);

The instruction table.

Implemented as a HashMap behind the scenes.

Methods

impl<T: Debug> InstructionTable<T>[src]

pub fn new() -> InstructionTable<T>[src]

Create a new empty instruction table.

pub fn by_op_code(&self, op_code: usize) -> Option<&Instruction<T>>[src]

Retrieve an instruction by looking up it's op code.

pub fn by_name(&self, name: &str) -> Option<&Instruction<T>>[src]

Retrieve an instruction by looking up it's name.

pub fn insert(&mut self, instr: Instruction<T>)[src]

Insert an instruction into the table.

pub fn is_empty(&self) -> bool[src]

Returns true if the instruction table is empty.

pub fn symbols(&self) -> Vec<(usize, String)>[src]

Returns a list of symbols for use in the Code struct.

Generates a vector of tuples containing the op code and the name of each instruction.

Trait Implementations

impl<T: Default + Debug> Default for InstructionTable<T>[src]

impl<T: Debug + Debug> Debug for InstructionTable<T>[src]

Auto Trait Implementations

impl<T> Send for InstructionTable<T>

impl<T> Sync for InstructionTable<T>

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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