VM

Struct VM 

Source
pub struct VM<'t> { /* private fields */ }
Expand description

Virtual machine state for query execution.

Implementations§

Source§

impl<'t> VM<'t>

Source

pub fn builder(source: &'t str, tree: &'t Tree) -> VMBuilder<'t>

Create a VM builder.

Source

pub fn new( source: &'t str, tree: &'t Tree, trivia_types: Vec<u16>, limits: FuelLimits, ) -> VM<'t>

👎Deprecated: Use VM::builder(source, tree).trivia_types(…).build() instead

Create a new VM for execution.

Source

pub fn execute( self, module: &Module, bootstrap: u16, entrypoint: &Entrypoint, ) -> Result<EffectLog<'t>, RuntimeError>

Execute query from entrypoint, returning effect log.

This is a convenience method that uses NoopTracer, which gets completely optimized away at compile time.

Source

pub fn execute_with<T>( self, module: &Module, bootstrap: u16, entrypoint: &Entrypoint, tracer: &mut T, ) -> Result<EffectLog<'t>, RuntimeError>
where T: Tracer,

Execute query with a tracer for debugging.

The tracer is generic, so NoopTracer calls are optimized away while PrintTracer calls collect execution trace.

bootstrap is the preamble entry point - caller decides which preamble to use.

Auto Trait Implementations§

§

impl<'t> Freeze for VM<'t>

§

impl<'t> RefUnwindSafe for VM<'t>

§

impl<'t> Send for VM<'t>

§

impl<'t> Sync for VM<'t>

§

impl<'t> Unpin for VM<'t>

§

impl<'t> UnwindSafe for VM<'t>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.