gen_server: TimerHandle arm_after/cancel + Sys::Timer dispatch (RFC 015 §4.3, §5)

This commit is contained in:
smarm-agent
2026-06-18 18:58:00 +00:00
parent 57eadb5c6c
commit 401a1465d5
5 changed files with 211 additions and 15 deletions
+11
View File
@@ -75,6 +75,17 @@ pub enum Reason {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct TimerId(u64);
impl TimerId {
/// Wrap a raw value. Crate-internal: the gen_server timer layer mints its
/// own loop-local `TimerId`s (the public ids it hands out, decoupled from
/// the per-re-arm substrate `seq`) and maps them to live substrate ids.
/// These local ids are only ever resolved through that layer's registry —
/// never passed back to [`Timers::cancel`] — so the two id roles do not mix.
pub(crate) fn from_raw(v: u64) -> Self {
TimerId(v)
}
}
/// Callback the scheduler invokes when a `WaitTimeout` entry pops.
///
/// Implementors: do not touch `SchedulerState` other than via the public