Skip to main content

Clock

Trait Clock 

Source
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§

Source

fn now_ms(&self) -> i64

The current time in Unix epoch milliseconds.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Clock for ManualClock

Source§

impl Clock for SystemClock

Available on non-WebAssembly only.