libdav/
names.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright 2023-2024 Hugo Osvaldo Barrera
//
// SPDX-License-Identifier: EUPL-1.2

//! Names of common dav attributes and properties.

use crate::PropertyName;

/// Namespace for properties defined in the WebDAV specifications.
pub const DAV: &str = "DAV:";
/// Namespace for properties defined in the CalDAV specifications.
pub const CALDAV: &str = "urn:ietf:params:xml:ns:caldav";
/// Namespace for properties defined in the CardDAV specifications.
pub const CARDDAV: &str = "urn:ietf:params:xml:ns:carddav";
/// Namespace for properties defined by Apple / ical.
pub const APPLE: &str = "http://apple.com/ns/ical/";

/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.3>
pub const COLLECTION: PropertyName = PropertyName::new(DAV, "collection");
/// Property name for collections display name.
///
/// Defined in: <https://www.rfc-editor.org/rfc/rfc4918#section-15.2>
///
/// Also, from <https://www.rfc-editor.org/rfc/rfc3744#section-4>:
///
/// > A principal MUST have a non-empty DAV:displayname property
pub const DISPLAY_NAME: PropertyName = PropertyName::new(DAV, "displayname");
/// Contains the Content-Type header value.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-15.5>
pub const GETCONTENTTYPE: PropertyName = PropertyName::new(DAV, "getcontenttype");
/// Contains the etag header value.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-15.6>
pub const GETETAG: PropertyName = PropertyName::new(DAV, "getetag");
/// An URI or relative reference.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.7>
pub const HREF: PropertyName = PropertyName::new(DAV, "href");
/// Contains types for a resource. Types can be from any namespace.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-15.9>
pub const RESOURCETYPE: PropertyName = PropertyName::new(DAV, "resourcetype");
/// A response container.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.24>
pub const RESPONSE: PropertyName = PropertyName::new(DAV, "response");
/// Holds a single HTTP status-line.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.28>
pub const STATUS: PropertyName = PropertyName::new(DAV, "status");
/// MUST contain one prop XML element and one status XML element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.22>
pub const PROPSTAT: PropertyName = PropertyName::new(DAV, "propstat");
/// Reports supported by a resource.
///
/// From: <https://www.rfc-editor.org/rfc/rfc3253#section-3.1.5>
pub const SUPPORTED_REPORT_SET: PropertyName = PropertyName::new(DAV, "supported-report-set");
/// From: <https://www.rfc-editor.org/rfc/rfc6578>
pub const SYNC_COLLECTION: PropertyName = PropertyName::new(DAV, "sync-collection");
/// From: <https://www.rfc-editor.org/rfc/rfc5397>
pub const CURRENT_USER_PRINCIPAL: PropertyName = PropertyName::new(DAV, "current-user-principal");

// CALENDAR PROPERTIES ==========

/// Resource type of a calendar collection.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.1>
pub const CALENDAR: PropertyName = PropertyName::new(CALDAV, "calendar");
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-5.2.1>
pub const CALENDAR_DESCRIPTION: PropertyName = PropertyName::new(CALDAV, "calendar-description");
/// Defined in <https://www.rfc-editor.org/rfc/rfc4791#section-6.2.1>
pub const CALENDAR_HOME_SET: PropertyName = PropertyName::new(CALDAV, "calendar-home-set");
/// A calendar's colour.
///
/// This is not a formally standardised property, but is relatively widespread. The value of this
/// property should be an unescaped hex value with a leading pound sign (e.g. `#ff0000`).
pub const CALENDAR_COLOUR: PropertyName =
    PropertyName::new("http://apple.com/ns/ical/", "calendar-color");
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.6>
pub const CALENDAR_DATA: PropertyName = PropertyName::new(CALDAV, "calendar-data");
/// Sorting order for calendars.
///
/// Not documented anywhere. Supported by various clients and servers.
pub const CALENDAR_ORDER: PropertyName = PropertyName::new(APPLE, "calendar-order");

// ADDRESS BOOK PROPERTIES ==========

/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-10.1>
pub const ADDRESSBOOK: PropertyName = PropertyName::new(CARDDAV, "addressbook");
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-6.2.1>
pub const ADDRESSBOOK_DESCRIPTION: PropertyName =
    PropertyName::new(CARDDAV, "addressbook-description");
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-7.1.1>
pub const ADDRESSBOOK_HOME_SET: PropertyName =
    PropertyName::new("urn:ietf:params:xml:ns:carddav", "addressbook-home-set");
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-10.4>
pub const ADDRESS_DATA: PropertyName = PropertyName::new(CARDDAV, "address-data");