pub trait TimerApi: Send + 'static {
type Timer: Timer<Key = Self::Key, Instant = Self::Instant, Duration = Self::Duration, Message = Self::Message>;
type Instant;
type Duration;
type Key;
type Message;
// Required methods
fn cancel(
&mut self,
key: Self::Key,
) -> impl Future<Output = Result<(), TimerError>> + Send;
fn schedule_once_at(
&mut self,
key: Self::Key,
at: Self::Instant,
msg: Self::Message,
) -> impl Future<Output = Result<(), TimerError>> + Send;
fn schedule_once_after(
&mut self,
key: Self::Key,
after: Self::Duration,
msg: Self::Message,
) -> impl Future<Output = Result<(), TimerError>> + Send;
}Required Associated Types§
type Timer: Timer<Key = Self::Key, Instant = Self::Instant, Duration = Self::Duration, Message = Self::Message>
type Instant
type Duration
type Key
type Message
Required Methods§
fn cancel( &mut self, key: Self::Key, ) -> impl Future<Output = Result<(), TimerError>> + Send
fn schedule_once_at( &mut self, key: Self::Key, at: Self::Instant, msg: Self::Message, ) -> impl Future<Output = Result<(), TimerError>> + Send
fn schedule_once_after( &mut self, key: Self::Key, after: Self::Duration, msg: Self::Message, ) -> impl Future<Output = Result<(), TimerError>> + 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.