pub trait AsyncLocalSleepExt: AsyncLocalSleep {
    // Required methods
    fn sleep_local(after: Duration) -> Self
       where Self: Sized;
    fn sleep_local_until(deadline: Instant) -> Self
       where Self: Sized;
}
Available on crate feature time only.
Expand description

Extension trait for AsyncLocalSleep.

Required Methods§

source

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

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

source

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

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

Implementors§

source§

impl AsyncLocalSleepExt for AsyncIoSleep

Available on crate feature async-io only.
source§

impl AsyncLocalSleepExt for TokioSleep

Available on crate feature tokio only.
source§

impl AsyncLocalSleepExt for WasmSleep

Available on crate feature wasm only.