Skip to main content

CacheClock

Trait CacheClock 

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

Wall-clock abstraction so tests can race past the cache TTL without sleeping.

Required Methods§

Source

fn now(&self) -> Instant

Current monotonic time. Production uses Instant::now; ManualClock returns whatever the test arranged.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§