Expand description
Unified mock time runtime.
This module provides the deterministic test-time model used by mock clocks
and mock sleepers. The central type is MockTimeline, a shared monotonic
elapsed-time source. MockClock maps that elapsed time onto UTC wall-clock
readings, while crate::sleep::MockSleeper turns relative sleeps into
waits on the same timeline. MockTime is the convenience facade for the
common case where one test needs a clock and a sleeper that advance together.
All mock components are intentionally driven by explicit calls to
MockTimeline::advance or MockTime::advance. Real wall-clock time is
used only for test-observability guard timeouts, such as
MockTimeline::wait_for_blocked_waiters, so tests can fail instead of
hanging forever.
Structs§
- Mock
Clock - Clock implementation whose readings are derived from a shared mock timeline.
- Mock
Instant - A monotonic instant measured from a
crate::MockTimelineorigin. - Mock
Time - A complete mock time runtime sharing one timeline across clocks and sleepers.
- Mock
Timeline - Shared monotonic time source for deterministic tests.
Enums§
- Mock
Time Error - Error returned when a mock time control operation is rejected.
- Mock
Waiter Kind - Identifies waiter groups tracked by
crate::MockTimeline.