pub trait TraceHandler:
Send
+ Sync
+ 'static {
// Required method
fn on_trace(&self, process: &ProcessorState<'_>) -> Result<(), TraceError>;
}Expand description
Handles an optional, read-only trace event emitted by the VM.
Trace events are emitted by pushing the user trace event ID and then
SystemEvent::TraceEvent onto the stack before emit. When the handler runs,
SystemEvent::TraceEvent is at stack position 0 and the user trace event ID is at position
- The handler receives a read-only
ProcessorStateand cannot return advice mutations.
Required Methods§
Sourcefn on_trace(&self, process: &ProcessorState<'_>) -> Result<(), TraceError>
fn on_trace(&self, process: &ProcessorState<'_>) -> Result<(), TraceError>
Handles the trace event when triggered.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<F> TraceHandler for F
Default implementation for both free functions and closures with signature
fn(&ProcessorState) -> Result<(), TraceError>