Skip to main content

Clock

Trait Clock 

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

A source of wall-clock time.

Required Methods§

Source

fn now(&self) -> SystemTime

The current time.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<C: Clock> Clock for Arc<C>

Lets a test keep a handle to a clock it gave to a runtime.

Source§

fn now(&self) -> SystemTime

Implementors§