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

Methods

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

[src]

Create a new instruction.

Trait Implementations

impl<T: Debug> Debug for Instruction<T>
[src]

[src]

Formats the value using the given formatter.