Skip to main content

Clock

Trait Clock 

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

The time source. Injectable so grant expiry and poll pacing are testable without sleeping; production hosts use SystemClock.

Required Methods§

Source

fn now(&self) -> SystemTime

The current instant.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§