Skip to content

calternal_dav::reminders

iCalendar VTODO resources for Markdown Tasks.

Markdown remains authoritative. This module only converts the existing task projection to and from the small VTODO property set that the Notes writer can store without losing data. Preserved Apple wire values cannot override later Markdown dates or priority (#643; DESIGN §31). Scheduled-only Tasks expose Apple’s visible DUE while retaining their scheduled role (#647).

Source: crates/calternal-dav/src/reminders.rs

pub struct ReminderTask

A Task row ready for CalDAV. The Index supplies the projected fields. The Notes ETags cover the complete Markdown fingerprint and VTODO bytes. An edit to prose or a sibling checkbox also invalidates stale writes (#643).

Fields

  • pub uid: String: Stable CalDAV resource UID. Notes maps this UID to the current Task row, so changing a Task’s calternal-id or moving its Markdown file does not change the resource identity that Reminders clients sync.
  • pub task: TaskIndexEntry
  • pub related_to: Option<String>
  • pub url: String
  • pub etag: String
  • pub completed: Option<String>
  • pub dav_metadata: TaskDavMetadata

Implements: Clone, Debug, PartialEq, Eq

pub fn icalendar(&self) -> String

Project authoritative Task fields; retain Apple precision only while it agrees with Markdown, so stale metadata cannot undo an edit (#643).

Source: crates/calternal-dav/src/reminders.rs:145

pub struct ReminderTaskEdit

Supported changes from a single incoming VTODO.

Fields

  • pub uid: String
  • pub title: String
  • pub status: TaskStatus
  • pub completed: Option<String>
  • pub due: Option<TaskDate>
  • pub dtstart: Option<TaskDate>
  • pub start: Option<TaskDate>
  • pub dtstart_role_start: bool
  • pub due_role_scheduled: bool: The parser already moved a projected scheduled DUE into dtstart. Keep this provenance so the provider can distinguish that normal form from a marker-free Apple date removal (#647).
  • pub priority: Option<TaskPriority>
  • pub recurrence: Option<String>: Canonical recurrence text, stored in Task frontmatter. No occurrence is generated by the VTODO projection.
  • pub related_to: Option<String>
  • pub url: Option<String>
  • pub alarms: Vec<String>: Raw, folded VALARM components. The Notes provider stores these with their Task UID because a rich Task file can project several VTODOs.
  • pub calendar_properties: Vec<String>: Original properties outside the Task fields. They stay folded and escaped as sent, then return on GET from the per-UID DAV metadata map.
  • pub timezones: Vec<String>
  • pub properties: Vec<String>
  • pub completed_at: Option<String>: A completion timestamp is separate from Task’s day-only completed field.
  • pub description: Option<String>
  • pub description_params: Option<String>

Implements: Clone, Debug, PartialEq, Eq

Source: crates/calternal-dav/src/reminders.rs:312

pub struct TaskDate

One civil date or wall-clock time. A named zone is DAV metadata; Task Markdown stores the local date and time as civil values.

Fields

  • pub date: CivilDate
  • pub time: Option<String>
  • pub timezone: Option<String>

Implements: Clone, Debug, PartialEq, Eq, Deserialize, Serialize

pub fn frontmatter_value(&self) -> String

No doc comment.

Source: crates/calternal-dav/src/reminders.rs:348

pub struct TaskDavMetadata

DAV-only state stored in Task frontmatter and copied into the rebuildable Index payload. It is keyed by a Task resource UID because one Task file can project a parent VTODO and several child VTODOs.

Fields

  • pub resource_uid: Option<String>
  • pub related_to: Option<String>
  • pub due_tzid: Option<String>
  • pub scheduled_tzid: Option<String>
  • pub start_tzid: Option<String>
  • pub due_value: Option<TaskDate>: Preserve the complete incoming values for resources whose Markdown checkbox representation has date-only fields (for example subtasks). The date part still updates the shared Task index; these values retain time precision and TZID for CalDAV round trips only while the current Markdown fields agree. Later Markdown edits always win (#643).
  • pub scheduled_value: Option<TaskDate>
  • pub start_value: Option<TaskDate>
  • pub alarms: Vec<String>
  • pub calendar_properties: Vec<String>: Properties that have no Markdown Task field stay with this DAV resource. Keeping their original folded content lines lets Apple extensions and future iCalendar properties survive a read and write cycle.
  • pub timezones: Vec<String>
  • pub properties: Vec<String>
  • pub completed_at: Option<String>
  • pub url: Option<String>
  • pub description_params: Option<String>
  • pub description: Option<String>: The Task body is the source of truth. This copy is added to the rebuildable Index projection so a DAV GET does not need a filesystem read after the task row has been decoded.

Implements: Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize

pub fn clear_absolute_alarms(&mut self)

Absolute TRIGGERs refer to an old instant after a civil-date or zone edit. Relative alarms can follow the new Task dates safely (#643).

Source: crates/calternal-dav/src/reminders.rs:34

pub type TaskDavMetadataByUid = BTreeMap<String, TaskDavMetadata>;

No doc comment.

Source: crates/calternal-dav/src/reminders.rs:139

pub fn parse_reminder_icalendar(body: &str) -> Result<ReminderTaskEdit, &'static str>

Parse one VTODO. Task fields map to Markdown; other valid content lines stay in per-resource metadata so clients can write properties we do not use. Scheduled-only DUE values return to the scheduled role, not a deadline (#647; DESIGN §31). A role marker also makes date removal lossless.

Source: crates/calternal-dav/src/reminders.rs:367

pub fn recurrence_to_rrule(value: &str) -> Option<String>

Return a safe RRULE only when the Task recurrence can be represented by the bounded VTODO recurrence subset.

Source: crates/calternal-dav/src/reminders.rs:1206

pub const TASK_DAV_METADATA_KEY: &str

No doc comment.

Source: crates/calternal-dav/src/reminders.rs:27