Skip to main content

VmDebugger

Trait VmDebugger 

Source
pub trait VmDebugger<SE>
where SE: ScriptExpression,
{ // Provided methods fn on_enter_scope( &mut self, scope: &VmScope<'_, SE>, context: &mut Context, registry: &Registry, ) { ... } fn on_exit_scope( &mut self, scope: &VmScope<'_, SE>, context: &mut Context, registry: &Registry, ) { ... } fn on_enter_operation( &mut self, scope: &VmScope<'_, SE>, operation: &ScriptOperation<'_, SE>, position: usize, context: &mut Context, registry: &Registry, ) { ... } fn on_exit_operation( &mut self, scope: &VmScope<'_, SE>, operation: &ScriptOperation<'_, SE>, position: usize, context: &mut Context, registry: &Registry, ) { ... } fn into_handle(self) -> Arc<RwLock<dyn VmDebugger<SE> + Send + Sync>> where Self: Sized + Send + Sync + 'static { ... } }
Expand description

Callbacks a VmScope makes while it runs.

Every method does nothing by default, so implement only the ones you need. They run inside the step, with the context and the registry to hand, so a debugger can read and even change what the script is working on.

Provided Methods§

Source

fn on_enter_scope( &mut self, scope: &VmScope<'_, SE>, context: &mut Context, registry: &Registry, )

Called once before the first operation of a scope.

Source

fn on_exit_scope( &mut self, scope: &VmScope<'_, SE>, context: &mut Context, registry: &Registry, )

Called when a step leaves the scope with nothing more to run, which is after its last operation or when an operation ends it early.

Source

fn on_enter_operation( &mut self, scope: &VmScope<'_, SE>, operation: &ScriptOperation<'_, SE>, position: usize, context: &mut Context, registry: &Registry, )

Called before each operation, with its index in the scope.

Source

fn on_exit_operation( &mut self, scope: &VmScope<'_, SE>, operation: &ScriptOperation<'_, SE>, position: usize, context: &mut Context, registry: &Registry, )

Called after each operation, with the index it ran at.

Source

fn into_handle(self) -> Arc<RwLock<dyn VmDebugger<SE> + Send + Sync>>
where Self: Sized + Send + Sync + 'static,

Wraps this debugger in a shared handle a scope can take.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§