Expand description
Functionality for simulating the passage of time in unit tests.
We do this by providing MockSleepProvider, a βSleepProviderβ
instance that can simulate timeouts and retries without requiring
the actual system clock to advance.
Β§Deprecated
This mock time facility has some limitations.
See MockSleepProvider for more information.
Use MockRuntime for new tests.
Re-exportsΒ§
use std::cmp::Eq;πuse std::cmp::Eq;πuse std::cmp::Ordering;πuse std::cmp::PartialEq;πuse std::cmp::PartialEq;πuse std::cmp::PartialOrd;πuse std::cmp::PartialOrd;πuse std::collections::BinaryHeap;πuse std::fmt;πuse std::pin::Pin;πuse std::sync::Arc;πuse std::sync::Mutex;πuse std::sync::Weak;πuse std::task::Context;πuse std::task::Poll;πuse std::task::Waker;πuse web_time_compat::Duration;πuse web_time_compat::Instant;πuse web_time_compat::InstantExt;πuse web_time_compat::SystemTime;πuse futures::Future;πuse tracing::trace;πuse std::collections::HashSet;πuse std::fmt::Formatter;πuse tor_rtcompat::CoarseInstant;πuse tor_rtcompat::CoarseTimeProvider;πuse tor_rtcompat::SleepProvider;πuse crate::time_core::MockTimeCore;π
StructsΒ§
- Mock
Sleep Provider Deprecated - A dummy
SleepProviderinstance for testing. - Sleep
Entry π - An entry telling us when to wake which future up.
- Sleep
Schedule π - Shared backend for sleep provider and Sleeping futures.
- Sleeping
- A future returned by
MockSleepProvider::sleep().