Skip to main content

record_scheduled_fire

Function record_scheduled_fire 

Source
pub fn record_scheduled_fire(
    t: &mut BreakTimers,
    kind: BreakKind,
    delivery: BreakDelivery,
    now: Instant,
    fixed_key: Option<(String, u32)>,
)
Expand description

Apply the timer bookkeeping for a scheduled micro/long break that has just fired. Pure analogue of the inline resets in run_loop’s fixed-time and interval fire paths, so the field-by-field divergence between the two break kinds (and between a fixed vs interval fire) is unit-testable without a windowing runtime or a live clock.

  • A Long fire resets both interval clocks (a long break implies a micro break just happened) and clears both warn/deferral flags; a Micro fire touches only the micro fields.
  • now is injected (the live call site passes Instant::now()).
  • fixed_key is Some((local-date, minute-of-day)) for a fixed-time fire — recording the dedupe key — and None for an interval fire.
  • active_break is only stashed for deliveries that hold the screen (Overlay / Windowed); a Notification leaves it unset.

Sleep never reaches here (it uses the bedtime fire path) and is a no-op for the per-kind resets.