automata/cron/iterator

Types

Cron iterator state. opaque because the cursor must stay synchronised with the embedded plan; constructing one with an arbitrary cursor would skip occurrences.

pub opaque type CronIterator

Outcome of one step on a CronIterator.

Yield(at:, next:) carries the next occurrence and a fresh iterator positioned just after it. Done indicates the search could not find a next occurrence within its internal recursion guard (~5,000,000 candidate minute steps, ≈ 9.5 years) or before the maximum representable DateTime boundary. UNIX cron is non-terminating, so for CronPlans derived from a validated ValidCron the Done arm is unreachable in practice and exists purely as a safety net for pathological inputs.

pub type Step {
  Yield(at: ast.ValidDateTime, next: CronIterator)
  Done
}

Constructors

Values

pub fn after(
  plan plan: normalize.CronPlan,
  boundary boundary: ast.Boundary,
) -> CronIterator
pub fn step(iterator: CronIterator) -> Step
Search Document