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§

source

fn sleep(after: Duration) -> Self
where Self: Sized,

Creates a timer that emits an event once after the given duration of time.

source

fn sleep_until(deadline: Instant) -> Self
where Self: Sized,

Creates a timer that emits an event once at the given time instant.

Implementors§