pub struct InstructionTable<T: Debug>(/* private fields */);
Expand description
The instruction table.
Implemented as a HashMap
behind the scenes.
Implementations§
Source§impl<T: Debug> InstructionTable<T>
impl<T: Debug> InstructionTable<T>
Sourcepub fn new() -> InstructionTable<T>
pub fn new() -> InstructionTable<T>
Create a new empty instruction table.
Sourcepub fn by_op_code(&self, op_code: usize) -> Option<&Instruction<T>>
pub fn by_op_code(&self, op_code: usize) -> Option<&Instruction<T>>
Retrieve an instruction by looking up it’s op code.
Sourcepub fn by_name(&self, name: &str) -> Option<&Instruction<T>>
pub fn by_name(&self, name: &str) -> Option<&Instruction<T>>
Retrieve an instruction by looking up it’s name.
Sourcepub fn insert(&mut self, instr: Instruction<T>)
pub fn insert(&mut self, instr: Instruction<T>)
Insert an instruction into the table.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for InstructionTable<T>
impl<T> RefUnwindSafe for InstructionTable<T>
impl<T> Send for InstructionTable<T>
impl<T> Sync for InstructionTable<T>
impl<T> Unpin for InstructionTable<T>
impl<T> UnwindSafe for InstructionTable<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more