Struct stack_vm::Instruction
[−]
[src]
pub struct Instruction<T: Debug> { pub op_code: usize, pub name: String, pub arity: usize, pub fun: InstructionFn<T>, }
Describes a single instruction which can be used to execute programs.
Contains: * An op code - a unique integer to identify this instruction. * A name for serialisation and debugging reasons. * An arity - the number of arguments this instruction expects to receive. * A function which is used to execute the instruction.
Fields
op_code: usize
name: String
arity: usize
fun: InstructionFn<T>
Methods
impl<T: Debug> Instruction<T>
[src]
fn new(
op_code: usize,
name: &str,
arity: usize,
fun: InstructionFn<T>
) -> Instruction<T>
[src]
op_code: usize,
name: &str,
arity: usize,
fun: InstructionFn<T>
) -> Instruction<T>
Create a new instruction.