Skip to main content

TimeContext

Trait TimeContext 

Source
pub trait TimeContext {
    // Required methods
    fn label(caller_context: &CallerContext) -> String;
    fn accumulate(milliseconds: &f64);

    // Provided method
    fn total_time() -> f64 { ... }
}
Expand description

Trait providing the context of actions to be carried by the timer

Required Methods§

Source

fn label(caller_context: &CallerContext) -> String

Adds the label to be used in the logs

Source

fn accumulate(milliseconds: &f64)

Includes de logic to accumulate the time in a global variable

Provided Methods§

Source

fn total_time() -> f64

Returns the total time spent in this context

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§