Expand description
Unified Clock trait for the Harn runtime.
Production code that needs the current time, monotonic measurement, or a
cancellable sleep takes an Arc<dyn Clock> and reads through it. Real
deployments wire RealClock; tests substitute PausedClock to drive
virtual time deterministically; recording layers wrap any inner clock with
RecordedClock to capture every observation for replay.
See docs/src/dev/testing.md for usage patterns.
Structs§
- Clock
Event Log - In-memory append-only log of clock observations.
- Paused
Clock - Fully-virtual clock for tests.
- Real
Clock - Production clock. Reads
OffsetDateTime::now_utc()andtokio::time::sleep. Honorstokio::time::pause()for sleep-driven scheduling butnow_utcalways returns true wall time. - Recorded
Clock - Wraps an inner
Clockand records every observation to aClockEventLog.
Enums§
- Clock
Event - Single observation captured by
RecordedClock.
Traits§
- Clock
- Unified clock abstraction.
Functions§
- now_
wall_ ms - Convenience: current wall-clock millis since UNIX_EPOCH.