AsyncLocalSleep

Trait AsyncLocalSleep 

Source
pub trait AsyncLocalSleep: Future<Output = Self::Instant> {
    type Instant: Instant;

    // Required method
    fn reset(self: Pin<&mut Self>, deadline: Self::Instant);
}
Available on crate feature time only.
Expand description

Like AsyncSleep, but does not requires Send.

Required Associated Types§

Source

type Instant: Instant

The instant type

Required Methods§

Source

fn reset(self: Pin<&mut Self>, deadline: Self::Instant)

Resets the Sleep instance to a new deadline.

The behavior of this function may different in different runtime implementations.

Implementors§

Source§

impl AsyncLocalSleep for AsyncIoSleep

Available on crate feature async-io only.
Source§

impl AsyncLocalSleep for TokioSleep

Available on crate feature tokio only.
Source§

impl AsyncLocalSleep for WasmSleep

Available on crate feature wasm only.