pub trait WallClockTimer {
type Id: Hash + Clone + Eq + Ord;
type State: State<Id = Self::Id>;
type Error: Error + Send + Sync + 'static;
// Required methods
fn schedule_at(
&mut self,
deadline: SystemTime,
state: Self::State,
) -> Result<(), Self::Error>;
fn cancel(&mut self, id: Self::Id) -> Result<(), Self::Error>;
}Expand description
A low-level wall-clock timer API.
Required Associated Types§
Required Methods§
Sourcefn schedule_at(
&mut self,
deadline: SystemTime,
state: Self::State,
) -> Result<(), Self::Error>
fn schedule_at( &mut self, deadline: SystemTime, state: Self::State, ) -> Result<(), Self::Error>
Schedule the state to be triggered at the given wall-clock deadline.