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.
Assembly programs emit trace events with trace, trace.CONST, or trace.event("..."). When
the handler runs, SystemEvent::TraceEvent is at stack position 0 and the user trace event ID
is at position 1. The handler receives a read-only ProcessorState and cannot return advice
mutations.
The instruction expansions are:
traceexpands topush.<sys::trace_event> emit drop.trace.CONSTandtrace.event("...")expand topush.<trace_id> push.<sys::trace_event> emit drop drop.
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>