Trait Interval

Source
pub trait Interval {
    // Required method
    async fn tick(&mut self) -> Result<(), Error>;
}
Expand description

A stream of periodic ticks, created by TimeAbstraction::interval.

Required Methods§

Source

async fn tick(&mut self) -> Result<(), Error>

Completes when the next period has been reached (unless there is an error).

If the stream consumer falls behind and multiple periods go by between reading from the stream, the stream will keep track of the missed periods and instantly yield them until caught up.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§