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 / SteppingClock) and pass it to the
unit under test.
Sibling to crate::sync::hlc::Hlc’s wall_clock: that one returns u64
millis for hybrid-logical-clock math, this one returns DateTime<Utc> for
created_at / updated_at / expiry comparisons. Both are injected wall
sources rooted at the same composition point; neither subsumes the other.
Structs§
- Fixed
Clock - Every
now()returns the same instant. - Stepping
Clock - Advances a fixed delta per
now()call: the first call returnsstart, the nextstart + step, and so on. For tests that assert ordering. - 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.
Type Aliases§
- Clock
Ref - Shared handle to a clock. Held by
Clonetypes (Database,LibraryManager) so they clone the handle, not the implementation.