timer_guarded

Macro timer_guarded 

Source
macro_rules! timer_guarded {
    ($slot:path, $delay:expr, $func:path $(, $($args:tt)*)? ) => { ... };
}
Expand description

timer_guarded Schedule a one-shot timer if none is already scheduled for the slot. Returns true when a new timer was scheduled.

§Examples

  • timer_guarded!(MY_TIMER, Duration::from_secs(5), do_cleanup);
  • timer_guarded!(MY_TIMER, Duration::ZERO, my_task, arg1, arg2);