Skip to main content

Instrument

Trait Instrument 

Source
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§

Source

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

Source

fn on_operation_execution_cycle(&mut self, op: Operation)

To be called each vm cycle an Operation is executed.

Source

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".

Implementors§