1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************************************
*
* Copyright (c) 2025 - 2026 Haixing Hu.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0.
*
******************************************************************************/
//! 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.
pub use MockClock;
pub use MockInstant;
pub use MockTime;
pub use MockTimeError;
pub use MockTimeline;
pub use MockWaiterKind;