Macro stakker::timer_min

source ·
macro_rules! timer_min {
    ( $var:expr, $inst:expr, $($x:tt)+ ) => { ... };
}
Expand description

Create or update a “Min” timer

A “Min” timer expires at the smallest (earliest) expiry time provided. See the MinTimerKey documentation for the characteristics of this timer. Modifies a MinTimerKey variable or structure member provided by the caller, which should be initialised with MinTimerKey::default(). If the timer key currently in the variable is invalid or expired, then a new timer is created using the call-args following, and the key stored in the variable. Otherwise the timer contained in the variable is updated with the provided expiry time, and the call-args are ignored. If necessary, the timer may be deleted using Core::timer_min_del.

The syntax of the calls is identical to lazy!, but with a variable reference and Instant argument first.

let mut var = MinTimerKey::default();
  :::
timer_min!(&mut var, instant, ...args-as-for-lazy-macro...);

Implemented using Core::timer_min_upd, Core::timer_min_add, Actor::apply and Actor::apply_prep.