AsyncSleepExt

Trait AsyncSleepExt 

Source
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§

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: Self::Instant) -> Self
where Self: Sized,

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

Implementors§