Struct stakker::MinTimerKey
source · pub struct MinTimerKey { /* private fields */ }
Expand description
Timer key for a Min timer
Used by the timer_min!
macro and the timer_min_*
methods in
Core
. It can be used to delete a timer or change its expiry
time. It is plain Copy
data, 8 bytes long. Note that the key
should only be used on this same Stakker instance. If it is
used on another then it might cause a panic.
A “min” timer is intended for use where the end-time is an estimate and where that estimate is progressively improved over time. The end-time is approached asymptotically to allow wiggle-room without having to update the underlying timer too many times, e.g. a 60s timer uses 5 timers in sequence, adjusting as it goes according to the latest estimate: ~15s before, ~4s before, ~1s before, ~0.125s before, then end-time itself. So for example in the first 45s, the timer can accomodate up to 15s of change in the end-time without having to delete a timer.
Trait Implementations§
source§impl Clone for MinTimerKey
impl Clone for MinTimerKey
source§fn clone(&self) -> MinTimerKey
fn clone(&self) -> MinTimerKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MinTimerKey
impl Debug for MinTimerKey
source§impl Default for MinTimerKey
impl Default for MinTimerKey
source§fn default() -> MinTimerKey
fn default() -> MinTimerKey
source§impl PartialEq<MinTimerKey> for MinTimerKey
impl PartialEq<MinTimerKey> for MinTimerKey
source§fn eq(&self, other: &MinTimerKey) -> bool
fn eq(&self, other: &MinTimerKey) -> bool
self
and other
values to be equal, and is used
by ==
.