Timer

Trait Timer 

Source
pub trait Timer: Send + 'static {
    type Key: Message + Ord + Clone + Send + Hash;
    type Instant: Copy + Send + Ord + Add<Self::Duration, Output = Self::Instant> + Sub<Self::Instant, Output = Self::Duration>;
    type Duration: Copy + Send + Default;
    type Message: Message;

    // Required method
    fn sleep(d: Self::Duration) -> impl Future<Output = ()> + Send;
}

Required Associated Types§

Source

type Key: Message + Ord + Clone + Send + Hash

Source

type Instant: Copy + Send + Ord + Add<Self::Duration, Output = Self::Instant> + Sub<Self::Instant, Output = Self::Duration>

Source

type Duration: Copy + Send + Default

Source

type Message: Message

Required Methods§

Source

fn sleep(d: Self::Duration) -> impl Future<Output = ()> + Send

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§