pub trait Instrument {
// Required methods
fn name(&self) -> &'static str;
fn on_operation_execution_cycle(&mut self, op: Operation);
fn write_report_to(&self, writer: &mut dyn Write) -> Result<()>;
}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)
fn on_operation_execution_cycle(&mut self, op: Operation)
To be called each vm cycle an Operation is executed.
Sourcefn write_report_to(&self, writer: &mut dyn Write) -> Result<()>
fn write_report_to(&self, writer: &mut dyn Write) -> Result<()>
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".