Skip to main content

prebreak_warn_due

Function prebreak_warn_due 

Source
pub fn prebreak_warn_due(
    enabled: bool,
    mode_includes_interval: bool,
    last_fire: Instant,
    interval_secs: u64,
    lead_secs: u64,
    already_warned: bool,
    idle_suppressed: bool,
    now: Instant,
) -> bool
Expand description

True iff the pre-break notification for this kind should fire now — i.e. we’re inside the lead window before a due interval break, and we haven’t already shown the notification for this cycle.

Pure analogue of the inline check in run_loop. The arg list is wide because the function is deliberately decoupled from Scheduler state so it can be driven by tests with synthetic instants — a wrapper struct would just shuffle the same fields around.