qubit_clock/sleep/mod.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Thread-blocking and asynchronous sleep abstractions.
11//!
12//! The sleep module intentionally models only relative sleeps. It does not
13//! expose deadlines, notifications, or condition waits; those belong to
14//! synchronization primitives such as monitors.
15//! [`SystemSleeper`] and [`MockSleeper`] implement [`Sleeper`], and also
16//! implement `AsyncSleeper` when the `tokio` feature is enabled.
17
18#[cfg(feature = "tokio")]
19mod async_sleep_future;
20#[cfg(feature = "tokio")]
21mod async_sleeper;
22mod mock_sleeper;
23mod sleeper;
24mod system_sleeper;
25
26#[cfg(feature = "tokio")]
27pub use async_sleep_future::AsyncSleepFuture;
28#[cfg(feature = "tokio")]
29pub use async_sleeper::AsyncSleeper;
30pub use mock_sleeper::MockSleeper;
31pub use sleeper::Sleeper;
32pub use system_sleeper::SystemSleeper;