pub trait NowSeconds: Send + Sync {
// Required method
fn now_seconds(&self) -> i64;
}Expand description
Clock abstraction for TTL “now” injection.
This trait exists solely so that tests can inject a deterministic timestamp
instead of reading SystemTime. The only production implementation is
SystemClock; tests use FixedClock.
Required Methods§
Sourcefn now_seconds(&self) -> i64
fn now_seconds(&self) -> i64
Return the current time as seconds since Unix epoch.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".