Skip to main content

Module recurrence

Module recurrence 

Source
Expand description

Recurrence rules (RFC 5545 RRULE) for jyn tasks.

A recurring task stores its rule as an RRULE body string (the part after RRULE:, e.g. FREQ=WEEKLY;BYDAY=MO) in Task.recurrence. This module validates such strings and computes the next occurrence, delegating the calendar arithmetic to the rrule crate.

Dates are anchored at UTC midnight: jyn tracks tasks by calendar date (NaiveDate), so the time-of-day and zone are irrelevant here and a fixed anchor keeps occurrences stable regardless of the user’s clock.

Structs§

RecurrenceError

Functions§

next_occurrence
Compute the next occurrence strictly after after, for a rule whose series is anchored at anchor (typically the task’s current due date). Returns Ok(None) when the series has no further occurrence (e.g. an exhausted COUNT/UNTIL).
validate
Validate an RRULE body string. Returns Ok(()) when the rule parses and builds, otherwise a RecurrenceError describing the problem.