Skip to main content

Module pause

Module pause 

Source

Structs§

PauseInfo
Renderer-facing pause status. remaining_secs is None for an indefinite pause and Some(seconds_left) for a timed pause.
SystemClock
Production clock — both methods just call their std counterpart.

Enums§

PauseState
Whether the scheduler is currently active, paused indefinitely, or paused until a specific Instant. The Option<Instant> in PausedUntil is None for indefinite pauses and Some(deadline) for time-bounded ones.

Traits§

Clock
Abstraction over the two clocks the pause module reads from. The snapshot/restore path samples both Instant::now() and SystemTime::now() to bridge monotonic deadlines and on-disk epoch timestamps. Tests can substitute a FakeClock that advances both in lockstep so assertions don’t need ±slack.

Functions§

now_epoch_secs 🔒
now_epoch_secs_with 🔒
persist_pause
Atomically write the current pause state to disk. The deadline is stored as an absolute epoch timestamp so a paused-until-X is honoured across process restarts.
restore_pause_state
Reconstruct a PauseState from the on-disk snapshot, used at scheduler boot. Timed pauses whose deadline already passed are cleared back to Running and the snapshot is rewritten.
restore_pause_state_with 🔒
snapshot_from_state 🔒
snapshot_from_state_with 🔒