calternal_dav::protocol
Virtual DAV collections. Paths select a user’s provider; they are never converted to filesystem paths. The server supplies authenticated identity. Log DELETE delegates child re-parenting to Notes; transfer hints restore only the deleted line, never its retained children (#471; DESIGN §46 A7). Every request XML tree uses the shared bounded reader first; byte limits alone do not bound tree depth or decoded allocation (#785, DESIGN §21).
Source: crates/calternal-dav/src/protocol.rs
Structs
Section titled “Structs”CalendarCollectionPatch
Section titled “CalendarCollectionPatch”pub struct CalendarCollectionPatchValidated updates for the writable Apple collection properties.
Fields
pub color: PropertyUpdate<String>pub order: PropertyUpdate<u32>
Implements: Clone, Debug, Default, PartialEq, Eq
Source: crates/calternal-dav/src/protocol.rs:270
CalendarCollectionProperties
Section titled “CalendarCollectionProperties”pub struct CalendarCollectionPropertiesThe values that Apple Calendar reads from an owned collection.
Fields
pub color: String: Always an opaque sRGB colour in#RRGGBBform.pub order: u32: Apple uses this integer to order calendars in its sidebar.
Implements: Clone, Debug, PartialEq, Eq
Source: crates/calternal-dav/src/protocol.rs:241
DavIdentity
Section titled “DavIdentity”pub struct DavIdentityIdentity is supplied by the server middleware, never by a DAV XML value.
Fields
pub user: Stringpub data_scope: bool
Implements: Clone
Source: crates/calternal-dav/src/protocol.rs:669
DavState
Section titled “DavState”pub struct DavStateNo doc comment.
Fields
pub journal: Arc<dyn JournalProvider>pub reminders: Arc<dyn RemindersProvider>pub external: Arc<dyn ExternalCalendarsProvider>pub collection_properties: Arc<dyn CalendarCollectionPropertiesProvider>
Implements: Clone
Source: crates/calternal-dav/src/protocol.rs:314
JournalChanges
Section titled “JournalChanges”pub struct JournalChangesNo doc comment.
Fields
pub cursor: i64pub token: Stringpub items: Vec<(String, bool)>
Source: crates/calternal-dav/src/protocol.rs:216
ReminderChanges
Section titled “ReminderChanges”pub struct ReminderChangesNo doc comment.
Fields
pub cursor: i64pub token: Stringpub items: Vec<(String, bool)>: Resource additions and tombstones since a prior cursor.pub initial_resources: Option<Vec<ReminderTask>>: Full resource snapshot for an initial sync. In this caseitemsis empty. The DAV handler uses these rows to build the response without issuing onegetper UID.
Source: crates/calternal-dav/src/protocol.rs:222
DavError
Section titled “DavError”pub enum DavErrorNo doc comment.
Variants
NotFoundConflictPreconditionInvalidInvalidSyncTokenInsufficientStorageServiceUnavailableInternal
Implements: Clone, Copy, Debug
Source: crates/calternal-dav/src/protocol.rs:34
PropertyUpdate
Section titled “PropertyUpdate”pub enum PropertyUpdate<T>One field update in an atomic collection-property patch.
Variants
Keep: Leave the current value unchanged.Set(T): Store a new value.Remove: Remove the override and use the collection default.
Implements: Clone, Debug, Default, PartialEq, Eq
Source: crates/calternal-dav/src/protocol.rs:258
Traits
Section titled “Traits”CalendarCollectionPropertiesProvider
Section titled “CalendarCollectionPropertiesProvider”pub trait CalendarCollectionPropertiesProvider: Send + SyncThe server adapter stores these client display properties in User settings.
collection is a stable identity, not a display name or filesystem path.
Area calendars can use their normalized area/<tag> identity here.
CalendarCollectionPropertiesProvider::read
Section titled “CalendarCollectionPropertiesProvider::read”fn read<'a>( &'a self, user: &'a str, collection: &'a str, ) -> ProviderFuture<'a, CalendarCollectionProperties>;No doc comment.
CalendarCollectionPropertiesProvider::read_many
Section titled “CalendarCollectionPropertiesProvider::read_many”fn read_many<'a>( &'a self, user: &'a str, collections: &'a [String], ) -> ProviderFuture<'a, Vec<CalendarCollectionProperties>>Read all properties for a calendar-home listing on one User settings snapshot. The default keeps replay providers small; the server adapter overrides it to avoid one filesystem read per area.
CalendarCollectionPropertiesProvider::update
Section titled “CalendarCollectionPropertiesProvider::update”fn update<'a>( &'a self, user: &'a str, collection: &'a str, patch: CalendarCollectionPatch, ) -> ProviderFuture<'a, ()>;No doc comment.
Source: crates/calternal-dav/src/protocol.rs:281
ExternalCalendarsProvider
Section titled “ExternalCalendarsProvider”pub trait ExternalCalendarsProvider: Send + Sync#40 will provide the derived external calendar cache and provider writes. Keeping it separate ensures Journal writes never enter that cache.
ExternalCalendarsProvider::names
Section titled “ExternalCalendarsProvider::names”fn names<'a>(&'a self, user: &'a str) -> ProviderFuture<'a, Vec<String>>;No doc comment.
Source: crates/calternal-dav/src/protocol.rs:235
JournalProvider
Section titled “JournalProvider”pub trait JournalProvider: Send + SyncThe Notes plugin implements these calls with conditional calternal-fs
writes. list must include an identity for every projected Log entry.
JournalProvider::list
Section titled “JournalProvider::list”fn list<'a>(&'a self, user: &'a str) -> ProviderFuture<'a, Vec<JournalEvent>>;No doc comment.
JournalProvider::deleted_copy
Section titled “JournalProvider::deleted_copy”fn deleted_copy<'a>( &'a self, _user: &'a str, _target_collection: &'a str, _requested_id: &'a str, _event: &'a JournalEvent, ) -> ProviderFuture<'a, Option<JournalEvent>>Find a recently deleted source after a server restart between Apple’s DELETE and PUT move requests. Providers without durable intents may use the process-local transfer hint in this protocol.
JournalProvider::clear_deleted_copy
Section titled “JournalProvider::clear_deleted_copy”fn clear_deleted_copy<'a>(&'a self, _user: &'a str, _id: &'a str) -> ProviderFuture<'a, ()>Remove a consumed durable transfer hint. A failed cleanup must not turn an already committed Log write into a failed DAV response.
JournalProvider::get_copy
Section titled “JournalProvider::get_copy”fn get_copy<'a>( &'a self, user: &'a str, collection: &'a str, tag: Option<&'a str>, copy_id: &'a str, ) -> ProviderFuture<'a, JournalEvent>Find one projected copy without requiring a full Daily note scan. Providers with a resource Index override this default replay path.
JournalProvider::area_tags
Section titled “JournalProvider::area_tags”fn area_tags<'a>(&'a self, user: &'a str) -> ProviderFuture<'a, Vec<String>>All area tags present in the User’s Home, including areas with no Log entries. The tag Index is rebuildable; it supplies this catalog.
JournalProvider::changes
Section titled “JournalProvider::changes”fn changes<'a>( &'a self, user: &'a str, since: Option<&'a str>, ) -> ProviderFuture<'a, JournalChanges>;No doc comment.
JournalProvider::sync_token
Section titled “JournalProvider::sync_token”fn sync_token<'a>(&'a self, user: &'a str) -> ProviderFuture<'a, String>Read the current collection token without materializing every resource. Providers that lack a cursor store can keep the default implementation; indexed providers should override it for collection discovery (#573).
JournalProvider::list_area
Section titled “JournalProvider::list_area”fn list_area<'a>( &'a self, user: &'a str, tag: Option<&'a str>, ids: Option<&'a std::collections::HashSet<String>>, ) -> ProviderFuture<'a, Vec<JournalEvent>>Read one area projection, optionally limited to resource IDs in a delta. The default keeps existing providers correct; persistent providers can use their area and resource indexes to avoid a Home-wide read (#573).
JournalProvider::list_area_copies
Section titled “JournalProvider::list_area_copies”fn list_area_copies<'a>( &'a self, user: &'a str, collection: &'a str, tag: Option<&'a str>, ids: &'a std::collections::HashSet<String>, ) -> ProviderFuture<'a, Vec<JournalEvent>>Resolve area copy IDs for calendar-multiget. Copy IDs are stable DAV identities that differ from the source Log block IDs used by sync. Providers with an alias index can avoid listing the full area.
JournalProvider::get
Section titled “JournalProvider::get”fn get<'a>(&'a self, user: &'a str, id: &'a str) -> ProviderFuture<'a, JournalEvent>;No doc comment.
JournalProvider::put
Section titled “JournalProvider::put”fn put<'a>( &'a self, user: &'a str, id: &'a str, event: JournalEvent, if_match: Option<&'a str>, if_none_match: bool, ) -> ProviderFuture<'a, JournalEvent>;No doc comment.
JournalProvider::delete
Section titled “JournalProvider::delete”fn delete<'a>( &'a self, user: &'a str, id: &'a str, if_match: &'a str, ) -> ProviderFuture<'a, ()>;No doc comment.
Source: crates/calternal-dav/src/protocol.rs:47
RemindersProvider
Section titled “RemindersProvider”pub trait RemindersProvider: Send + SyncThe Notes plugin implements Task reads and writes against Markdown. All identities and ETags are derived from the current task projection and its complete source bytes.
RemindersProvider::list
Section titled “RemindersProvider::list”fn list<'a>(&'a self, user: &'a str) -> ProviderFuture<'a, Vec<ReminderTask>>;No doc comment.
RemindersProvider::sync_token
Section titled “RemindersProvider::sync_token”fn sync_token<'a>(&'a self, user: &'a str) -> ProviderFuture<'a, String>;Return the collection token without reading every Task resource.
RemindersProvider::changes
Section titled “RemindersProvider::changes”fn changes<'a>( &'a self, user: &'a str, since: Option<&'a str>, ) -> ProviderFuture<'a, ReminderChanges>;No doc comment.
RemindersProvider::get
Section titled “RemindersProvider::get”fn get<'a>(&'a self, user: &'a str, id: &'a str) -> ProviderFuture<'a, ReminderTask>;No doc comment.
RemindersProvider::put
Section titled “RemindersProvider::put”fn put<'a>( &'a self, user: &'a str, id: &'a str, task: ReminderTaskEdit, if_match: Option<&'a str>, if_none_match: bool, ) -> ProviderFuture<'a, ReminderTask>;No doc comment.
RemindersProvider::delete
Section titled “RemindersProvider::delete”fn delete<'a>( &'a self, user: &'a str, id: &'a str, if_match: &'a str, ) -> ProviderFuture<'a, ()>;No doc comment.
Source: crates/calternal-dav/src/protocol.rs:190
Type aliases
Section titled “Type aliases”ProviderFuture
Section titled “ProviderFuture”pub type ProviderFuture<'a, T> = Pin<Box<dyn Future<Output = Result<T, DavError>> + Send + 'a>>;No doc comment.
Source: crates/calternal-dav/src/protocol.rs:31
Functions
Section titled “Functions”normalize_dav_calendar_color
Section titled “normalize_dav_calendar_color”pub fn normalize_dav_calendar_color(value: &str) -> Option<String>Normalize the RGB or RGBA hex value used by Apple to opaque #RRGGBB.
Source: crates/calternal-dav/src/protocol.rs:544
router
Section titled “router”pub fn router(state: DavState) -> RouterExpose DAV resources and redirect discovery requests to /dav/ (#908).
The server must install DavIdentity after credential validation.
Handlers require Authorization and data scope; a browser cookie alone
does not grant DAV access (DESIGN §14, §30).
Source: crates/calternal-dav/src/protocol.rs:678
Constants
Section titled “Constants”DEFAULT_CALENDAR_COLOR
Section titled “DEFAULT_CALENDAR_COLOR”pub const DEFAULT_CALENDAR_COLOR: &strThe default accent for the default Paper theme.