Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required method
    fn now(&self) -> Duration;
}
Expand description

Time as the UI sees it. Apps use real time; tests use a manual clock.

Required Methods§

Source

fn now(&self) -> Duration

Time elapsed since the clock started.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Clock for Rc<ManualClock>

Source§

fn now(&self) -> Duration

Implementors§