pub trait Clock: MaybeSend + MaybeSync {
// Required method
fn now_ms(&self) -> i64;
}Expand description
Injected time source, in Unix epoch milliseconds.
Nothing in mkit-server reads SystemTime or Instant directly:
Instant::now() panics on wasm32 (see
apps/mkit-worker-common/src/adapter.rs), and tests need to control
time. Adapters pass their runtime’s clock in.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Clock for ManualClock
impl Clock for SystemClock
Available on non-WebAssembly only.