Expand description
Wall-clock source, injected so consumers read “now” deterministically in tests.
Production wires SystemClock (real Utc::now()); tests construct a
deterministic fake (FixedClock / ClosureClock) and pass it to the
unit under test.
The hybrid logical clock retains this same clock and derives epoch
milliseconds from it. Other consumers use the full
DateTime<Utc> for created_at, updated_at, and expiry comparisons.
Structs§
- Closure
Clock - Delegates each read to a supplied test function.
- Fixed
Clock - Every
now()returns the same instant. - Stopwatch
- Elapsed real time, for measuring how long a piece of work took.
- System
Clock - Production clock: real wall time.
Traits§
- Clock
- Wall-clock source. Returns a full
DateTime<Utc>; callers derive.timestamp()/.to_rfc3339()as they need.
Functions§
- clock_
from_ millis - A
ClockRefreading epoch milliseconds from a test-supplied source, for the hybrid-logical-clock tests that think in milliseconds rather thanDateTimes.
Type Aliases§
- Clock
Ref - Shared handle to a clock. Held by
Clonetypes (CovenHandle,CovenReadHandle) so they clone the handle, not the implementation.