pub trait AsyncSleepExt: AsyncSleep {
// Required methods
fn sleep(after: Duration) -> Self
where Self: Sized;
fn sleep_until(deadline: Self::Instant) -> Self
where Self: Sized;
}Available on crate feature
time only.Expand description
Extension trait for AsyncSleep.
Required Methods§
Sourcefn sleep(after: Duration) -> Selfwhere
Self: Sized,
fn sleep(after: Duration) -> Selfwhere
Self: Sized,
Creates a timer that emits an event once after the given duration of time.
Sourcefn sleep_until(deadline: Self::Instant) -> Selfwhere
Self: Sized,
fn sleep_until(deadline: Self::Instant) -> Selfwhere
Self: Sized,
Creates a timer that emits an event once at the given time instant.