Skip to main content

Clock

Trait Clock 

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

Wall-clock seam so token-expiry logic is deterministically testable.

Production uses SystemClock; tests inject a controllable clock to exercise pre-flight refresh and single-flight without sleeping.

Required Methods§

Source

fn now(&self) -> Timestamp

The current wall-clock instant.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§