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§
Sourcefn on_enter_scope(
&mut self,
scope: &VmScope<'_, SE>,
context: &mut Context,
registry: &Registry,
)
fn on_enter_scope( &mut self, scope: &VmScope<'_, SE>, context: &mut Context, registry: &Registry, )
Called once before the first operation of a scope.
Sourcefn on_exit_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, )
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.
Sourcefn on_enter_operation(
&mut self,
scope: &VmScope<'_, SE>,
operation: &ScriptOperation<'_, SE>,
position: usize,
context: &mut Context,
registry: &Registry,
)
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.
Sourcefn on_exit_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, )
Called after each operation, with the index it ran at.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".