[−][src]Struct stack_vm::InstructionTable
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]
fn default() -> 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]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,