pub struct BitWheelWithFailover<T, const NUM_GEARS: usize = DEFAULT_GEARS, const RESOLUTION_MS: u64 = DEFAULT_RESOLUTION_MS, const SLOT_CAP: usize = DEFAULT_SLOT_CAP, const MAX_PROBES: usize = DEFAULT_MAX_PROBES, const FAILOVER_INTERVAL: u64 = DEFAULT_FAILOVER_INTERVAL> { /* private fields */ }Implementations§
Source§impl<T, const NUM_GEARS: usize, const RESOLUTION_MS: u64, const SLOT_CAP: usize, const MAX_PROBES: usize, const FAILOVER_INTERVAL: u64> BitWheelWithFailover<T, NUM_GEARS, RESOLUTION_MS, SLOT_CAP, MAX_PROBES, FAILOVER_INTERVAL>
impl<T, const NUM_GEARS: usize, const RESOLUTION_MS: u64, const SLOT_CAP: usize, const MAX_PROBES: usize, const FAILOVER_INTERVAL: u64> BitWheelWithFailover<T, NUM_GEARS, RESOLUTION_MS, SLOT_CAP, MAX_PROBES, FAILOVER_INTERVAL>
pub fn new() -> Self
pub fn with_epoch(epoch: Instant) -> Self
pub fn boxed() -> Box<Self>
pub fn boxed_with_epoch(epoch: Instant) -> Box<Self>
Sourcepub fn insert(&mut self, when: Instant, timer: T) -> TimerHandle
pub fn insert(&mut self, when: Instant, timer: T) -> TimerHandle
Insert never fails — falls back to BTreeMap if wheel is full
pub fn cancel(&mut self, handle: TimerHandle) -> Option<T>
pub fn poll(&mut self, now: Instant, ctx: &mut T::Context) -> usizewhere
T: Timer,
pub fn is_empty(&self) -> bool
pub fn duration_until_next(&self) -> Option<Duration>
Sourcepub fn failover_len(&self) -> usize
pub fn failover_len(&self) -> usize
Timers currently in failover
Trait Implementations§
Source§impl<T, const NUM_GEARS: usize, const RESOLUTION_MS: u64, const SLOT_CAP: usize, const MAX_PROBES: usize, const FAILOVER_INTERVAL: u64> Default for BitWheelWithFailover<T, NUM_GEARS, RESOLUTION_MS, SLOT_CAP, MAX_PROBES, FAILOVER_INTERVAL>
impl<T, const NUM_GEARS: usize, const RESOLUTION_MS: u64, const SLOT_CAP: usize, const MAX_PROBES: usize, const FAILOVER_INTERVAL: u64> Default for BitWheelWithFailover<T, NUM_GEARS, RESOLUTION_MS, SLOT_CAP, MAX_PROBES, FAILOVER_INTERVAL>
Source§impl<T, const G: usize, const R: u64, const S: usize, const P: usize, const F: u64> TimerDriver<T> for BitWheelWithFailover<T, G, R, S, P, F>where
T: Timer,
impl<T, const G: usize, const R: u64, const S: usize, const P: usize, const F: u64> TimerDriver<T> for BitWheelWithFailover<T, G, R, S, P, F>where
T: Timer,
Source§fn insert(
&mut self,
when: Instant,
timer: T,
) -> Result<TimerHandle, InsertError<T>>
fn insert( &mut self, when: Instant, timer: T, ) -> Result<TimerHandle, InsertError<T>>
Infallible insert - always succeeds, overflows to BTreeMap.