Skip to main content

Profiler

Trait Profiler 

Source
pub trait Profiler {
    // Required methods
    fn new() -> Self;
    fn prepare(&mut self);
    fn update(&mut self);
    fn finish(&self, label: &str, wake_time: Duration, sleep_time: Duration);
    fn error(&self, label: &str);
}

Required Methods§

Source

fn new() -> Self

Source

fn prepare(&mut self)

called before poll

Source

fn update(&mut self)

called after poll

Source

fn finish(&self, label: &str, wake_time: Duration, sleep_time: Duration)

logs the metrics. it takes as arguments the metrics collected by the AsyncTracer too.

Source

fn error(&self, label: &str)

called when the future is dropped early

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§