pub struct VM<'t> { /* private fields */ }Expand description
Virtual machine state for query execution.
Implementations§
Source§impl<'t> VM<'t>
impl<'t> VM<'t>
Sourcepub 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
pub fn new( source: &'t str, tree: &'t Tree, trivia_types: Vec<u16>, limits: FuelLimits, ) -> VM<'t>
Create a new VM for execution.
Sourcepub fn execute(
self,
module: &Module,
bootstrap: u16,
entrypoint: &Entrypoint,
) -> Result<EffectLog<'t>, RuntimeError>
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.
Sourcepub fn execute_with<T>(
self,
module: &Module,
bootstrap: u16,
entrypoint: &Entrypoint,
tracer: &mut T,
) -> Result<EffectLog<'t>, RuntimeError>where
T: Tracer,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more