Struct fuel_vm::interpreter::Interpreter
source ·
[−]pub struct Interpreter<S> { /* private fields */ }
Expand description
VM interpreter.
The internal state of the VM isn’t expose because the intended usage is to either inspect the resulting receipts after a transaction execution, or the resulting mutated transaction.
These can be obtained with the help of a crate::transactor::Transactor
or a client implementation.
Implementations
Create a new interpreter instance out of a storage implementation.
If the provided storage implements
crate::storage::InterpreterStorage
, the returned interpreter
will provide full functionality.
Create a new interpreter without a storage backend.
It will have restricted capabilities.
Create a new storage with a provided in-memory storage.
It will have full capabilities.
Execute the current instruction pair located in $m[$pc]
.
pub fn instruction(
&mut self,
instruction: Instruction
) -> Result<ExecuteState, InterpreterError>
pub fn instruction(
&mut self,
instruction: Instruction
) -> Result<ExecuteState, InterpreterError>
Execute a provided instruction
pub fn transact_owned(
storage: S,
tx: Transaction
) -> Result<StateTransition, InterpreterError>
pub fn transact_owned(
storage: S,
tx: Transaction
) -> Result<StateTransition, InterpreterError>
Allocate internally a new instance of Interpreter
with the provided
storage, initialize it with the provided transaction and return the
result of th execution in form of StateTransition
pub fn transact(
&mut self,
tx: Transaction
) -> Result<StateTransitionRef<'_>, InterpreterError>
pub fn transact(
&mut self,
tx: Transaction
) -> Result<StateTransitionRef<'_>, InterpreterError>
Initialize a pre-allocated instance of Interpreter
with the provided
transaction and execute it. The result will be bound to the lifetime
of the interpreter and will avoid unnecessary copy with the data
that can be referenced from the interpreter instance itself.
Returns the current state of the VM memory
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<S> RefUnwindSafe for Interpreter<S> where
S: RefUnwindSafe,
impl<S> Send for Interpreter<S> where
S: Send,
impl<S> Sync for Interpreter<S> where
S: Sync,
impl<S> Unpin for Interpreter<S> where
S: Unpin,
impl<S> UnwindSafe for Interpreter<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more