pub struct TimerHandle { /* private fields */ }Expand description
Handle for cancelling a pending timer.
§Ownership Semantics
TimerHandle is intentionally not Clone or Copy. This ensures:
- Unique ownership: Only one handle exists per scheduled timer.
- Single cancellation: Once
cancel()consumes the handle, no double-cancel is possible.
§Creation
Handles are only created by [BitWheelInner::insert]. The internal
fields (gear, slot, key, when_offset) are not publicly constructible,
guaranteeing that any handle passed to cancel() refers to a valid
timer entry (assuming it hasn’t already fired).
§Validity
A handle becomes invalid once its when_offset tick has passed
(i.e., the timer has fired). Calling cancel() on an expired handle
safely returns None.