Skip to main content

AsyncLocalIntervalExt

Trait AsyncLocalIntervalExt 

Source
pub trait AsyncLocalIntervalExt: AsyncInterval {
    // Required methods
    fn interval_local(period: Duration) -> Self
       where Self: Sized;
    fn interval_local_at(start: Self::Instant, period: Duration) -> Self
       where Self: Sized;
}
Available on crate feature time only.
Expand description

Extension trait for AsyncLocalInterval.

Required Methods§

Source

fn interval_local(period: Duration) -> Self
where Self: Sized,

Creates a timer that emits events periodically.

Source

fn interval_local_at(start: Self::Instant, period: Duration) -> Self
where Self: Sized,

Creates a timer that emits events periodically, starting at start.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AsyncLocalIntervalExt for Timer

Available on crate feature async-io only.
Source§

fn interval_local(period: Duration) -> Self
where Self: Sized,

Available on crate feature time only.
Source§

fn interval_local_at(start: Instant, period: Duration) -> Self
where Self: Sized,

Available on crate feature time only.

Implementors§

Source§

impl AsyncLocalIntervalExt for EmbassyInterval

Available on crate feature embassy only.
Source§

impl AsyncLocalIntervalExt for TokioInterval

Available on crate feature tokio only.
Source§

impl AsyncLocalIntervalExt for WasmInterval

Available on crate feature wasm only.