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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Time utilities for the simulator runtime.
//!
//! This module provides sleep, interval, and timeout functions that work with
//! the simulator's controlled time advancement.
use IntoFuture;
use crate;
// Re-export types for compatibility
pub use crate;
pub use Duration;
// Re-export simulator functionality
/// Simulator-specific time utilities.
///
/// This module provides functions for controlling simulator time behavior.
/// Creates a future that completes after the specified duration.
///
/// This returns a `Sleep` future that will complete after the given duration has elapsed.
/// Time advancement is controlled by the simulator runtime.
/// Creates an interval that yields at a fixed rate.
///
/// This returns an `Interval` that yields values at regular intervals specified by the duration.
/// Time advancement is controlled by the simulator runtime.
/// Requires a future to complete before the specified duration.
///
/// This wraps the given future with a timeout. If the future doesn't complete within
/// the specified duration, the timeout future will return an `Elapsed` error.
/// Time advancement is controlled by the simulator runtime.