pub trait TimerWithContext: Timer {
type Context;
// Required method
fn new_with_context<C>(duration: Duration, context: C) -> Self
where C: AsMut<Self::Context>;
}
Expand description
Timer service provider trait with more configiration.
Required Associated Types§
Required Methods§
Sourcefn new_with_context<C>(duration: Duration, context: C) -> Self
fn new_with_context<C>(duration: Duration, context: C) -> Self
Create new timer with context parameter
§Parameters
duration
- Timer expiration intervalcontext
- SeeTimerWithContext::Context
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.