1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! High-performance timer wheel with O(1) insert and cancel.
//!
//! `nexus-timer` provides a hierarchical timer wheel inspired by the Linux
//! kernel's timer infrastructure (Gleixner 2016). Timers are placed into
//! coarser slots at higher levels — no cascading, no entry movement after
//! insertion.
//!
//! # Design
//!
//! - **No cascade:** Once placed, an entry never moves. Poll checks each
//! entry's exact deadline. This eliminates the latency spikes that
//! cascading timer wheels exhibit.
//! - **Intrusive active-slot lists:** Only non-empty slots are visited
//! during poll and next-deadline queries. No bitmap, no full scan.
//! - **Embedded refcounting:** Lightweight `Cell<u8>` refcount per entry
//! enables fire-and-forget timers alongside cancellable timers without
//! external reference-counting machinery.
//! - **Generic storage:** Parameterized over slab backend — bounded
//! (fixed-capacity) or unbounded (growable).
//!
//! # Quick Start
//!
//! ```
//! use std::time::{Duration, Instant};
//! use nexus_timer::Wheel;
//!
//! let now = Instant::now();
//! let mut wheel: Wheel<u64> = Wheel::unbounded(4096, now);
//!
//! // Schedule a timer 100ms from now
//! let handle = wheel.schedule(now + Duration::from_millis(100), 42u64);
//!
//! // Cancel before it fires — get the value back
//! let value = wheel.cancel(handle);
//! assert_eq!(value, Some(42));
//! ```
pub use WheelEntry;
pub use TimerHandle;
pub use ;
// Re-export Full for bounded wheel users
pub use Full;