pub trait Clock:
Send
+ Sync
+ 'static {
// Required methods
fn now(&self) -> MonoTime;
fn unix_time_us(&self) -> u64;
}Expand description
Injectable time source for mesh components.
§Production
Bind RealClock (or Arc::new(RealClock)).
§Tests
Bind MockClock and call MockClock::advance to drive timeouts
without sleeping.
Required Methods§
Sourcefn unix_time_us(&self) -> u64
fn unix_time_us(&self) -> u64
Wall-clock microseconds since Unix epoch (for mesh time sync).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".