pub trait Instrument {
// Required methods
fn name(&self) -> &'static str;
fn on_operation_execution_cycle(
&mut self,
op: Operation,
proc: Option<&str>,
);
fn write_report_to(&self, writer: &mut dyn OutputWriter) -> OutputResult<()>;
}Expand description
The functionality required for an instrument to be plugged in to Profiler.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
The human readable name of this instrument used in CLI arguments and user output
This should be the same name as the corresponding InstrumentRegistration::NAME constant
Sourcefn on_operation_execution_cycle(&mut self, op: Operation, proc: Option<&str>)
fn on_operation_execution_cycle(&mut self, op: Operation, proc: Option<&str>)
To be called each vm cycle an Operation is executed.
proc is the name of the most recent live procedure, or None when the operation cannot
be attributed to a procedure. For example, it is None while executing a program without
assembly operation metadata.
Sourcefn write_report_to(&self, writer: &mut dyn OutputWriter) -> OutputResult<()>
fn write_report_to(&self, writer: &mut dyn OutputWriter) -> OutputResult<()>
Write this instrumentation’s collected output as a report to writer
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".