pub trait Clock: Send + Sync {
// Required method
fn now_ms(&self) -> u64;
}Expand description
Narrow Send + Sync source of simulation time, suitable for plugging into
the SimTime formatter.
Distinct from moonpool_core::TimeProvider, which is Send + Sync but
not dyn-compatible (it has a generic timeout method). Anything that can
hand out a u64 representing “current sim time in milliseconds” can
implement this — typically the active SimulationLayerHandle, but
tests and alternate time sources can implement it too.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".