pub enum MockableClock {
Real,
Mock(Arc<TimerRegistry>),
}
Variants§
Real
Mock(Arc<TimerRegistry>)
Implementations§
source§impl MockableClock
impl MockableClock
pub fn mock() -> (Self, Arc<TimerRegistry>)
pub fn now(&self) -> Instant
pub async fn sleep(&self, duration: Duration) -> TimeHandlerGuard
pub async fn sleep_until(&self, until: Instant) -> TimeHandlerGuard
pub fn interval(&self, period: Duration) -> Interval
pub fn interval_at(&self, start: Instant, period: Duration) -> Interval
pub fn timeout<T>(&self, duration: Duration, future: T) -> Timeout<T> ⓘwhere T: Future,
pub fn timeout_at<T>(&self, deadline: Instant, future: T) -> Timeout<T> ⓘwhere T: Future,
Trait Implementations§
source§impl Clone for MockableClock
impl Clone for MockableClock
source§fn clone(&self) -> MockableClock
fn clone(&self) -> MockableClock
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more