Skip to main content

ClosureTimer

Trait ClosureTimer 

Source
pub trait ClosureTimer: WallClockTimer {
    // Required method
    fn schedule_action_at<F>(
        &mut self,
        id: Self::Id,
        deadline: SystemTime,
        action: F,
    ) -> Result<(), Self::Error>
       where F: FnOnce(Self::Id) + Send + 'static;
}
Expand description

Convenience API for timers that use the closure state types.

Required Methods§

Source

fn schedule_action_at<F>( &mut self, id: Self::Id, deadline: SystemTime, action: F, ) -> Result<(), Self::Error>
where F: FnOnce(Self::Id) + Send + 'static,

Schedule action to be executed at deadline.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I, T> ClosureTimer for T
where I: Hash + Clone + Eq, T: WallClockTimer<Id = I, State = ClosureState<I>>,