pub struct PeriodicClosureState<I> { /* private fields */ }
Expand description
A timeout state for a periodic timer using a closure as the triggering action
Implementations§
source§impl<I> PeriodicClosureState<I>
impl<I> PeriodicClosureState<I>
source§impl PeriodicClosureState<Uuid>
impl PeriodicClosureState<Uuid>
sourcepub fn with_random_id<F>(action: F) -> Selfwhere
F: FnMut(Uuid) -> TimerReturn<()> + Send + 'static,
pub fn with_random_id<F>(action: F) -> Selfwhere F: FnMut(Uuid) -> TimerReturn<()> + Send + 'static,
Produces a new instance of this state type using a random unique id and the action to be executed every time it expires.
Uses Uuid::new_v4()
internally.