Trait agnostic_lite::AsyncSleepExt
source · pub trait AsyncSleepExt: AsyncSleep {
// Required methods
fn sleep(after: Duration) -> Self
where Self: Sized;
fn sleep_until(deadline: Instant) -> Self
where Self: Sized;
}Available on crate feature
std 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: Instant) -> Selfwhere
Self: Sized,
fn sleep_until(deadline: Instant) -> Selfwhere
Self: Sized,
Creates a timer that emits an event once at the given time instant.