Skip to main content

Timer

Trait Timer 

Source
pub trait Timer:
    Send
    + Sync
    + 'static {
    // Required methods
    fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>;
    fn next_tick(&self) -> BoxFuture<'static, ()>;
}
Expand description

Async scheduling primitive. Single port for “wait N ms” / “yield event-loop tick”.

Required Methods§

Source

fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>

Source

fn next_tick(&self) -> BoxFuture<'static, ()>

Implementors§