Skip to main content

WaitTimer

Trait WaitTimer 

Source
pub trait WaitTimer:
    Send
    + Sync
    + Default
    + 'static {
    // Required method
    fn wait(&mut self, dur: Duration);
}
Expand description

Represents structs that can be waited of for a given duration. Functionaly equivalent to std::thread::sleep.

Required Methods§

Source

fn wait(&mut self, dur: Duration)

Sleeps for the given duration, blocking the thread. This function aims to have 1ms resolution, assuming the underlying platform allows it.

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§