Skip to main content

Clock

Trait Clock 

Source
pub trait Clock: Send + 'static {
    // Required method
    fn now(&self) -> SystemTime;
}
Expand description

Abstraction over time for testing.

Required Methods§

Source

fn now(&self) -> SystemTime

Return the current wall-clock time.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§