Struct aluvm::vm::Vm[][src]

pub struct Vm<Isa = Instr<ReservedOp>> where
    Isa: InstructionSet
{ /* fields omitted */ }
Expand description

Alu virtual machine providing single-core execution environment

Implementations

Method borrowing Vm::libs field. Libraries known to the runtime, identified by their hashes

Method borrowing Vm::entrypoint field. Entrypoint for the main function

Method borrowing Vm::registers field. A set of registers

Method borrowing Vm::phantom field.

Constructs new virtual machine with no code in it.

Calling Vm::main on it will result in machine termination with st0 set to false.

Constructs new virtual machine using the provided library.

Adds Alu bytecode library to the virtual machine.

Errors

Checks requirement that the total number of libraries must not exceed LIBS_MAX_TOTAL and returns Error::TooManyLibs otherwise.

Checks that the ISA used by the VM supports ISA extensions specified by the library and returns Error::IsaNotSupported otherwise.

Returns

true if the library was already known and false otherwise.

Sets new entry point value (used when calling Vm::main)

Executes the program starting from the provided entry point (set with Vm::set_entrypoint or initialized to 0 offset of the first used library if Vm::new, Vm::default or Vm::with were used).

Returns

Value of the st0 register at the end of the program execution.

Executes the program starting from the provided entry point.

Returns

Value of the st0 register at the end of the program execution.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.