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§
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 Methods§
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.