aboutsummaryrefslogtreecommitdiff
path: root/aero-dav/src/synctypes.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-05-29 10:14:51 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-05-29 10:14:51 +0200
commitb9ce5886033677f6c65a4b873e17574fdb8df31d (patch)
tree9ed1d721361027d7d6fef0ecad65d7e1b74a7ddb /aero-dav/src/synctypes.rs
parent0dcf69f180f5a7b71b6ad2ac67e4cdd81e5154f1 (diff)
parent5954de6efbb040b8b47daf0c7663a60f3db1da6e (diff)
downloadaerogramme-b9ce5886033677f6c65a4b873e17574fdb8df31d.tar.gz
aerogramme-b9ce5886033677f6c65a4b873e17574fdb8df31d.zip
Merge branch 'caldav'
Diffstat (limited to 'aero-dav/src/synctypes.rs')
-rw-r--r--aero-dav/src/synctypes.rs86
1 files changed, 86 insertions, 0 deletions
diff --git a/aero-dav/src/synctypes.rs b/aero-dav/src/synctypes.rs
new file mode 100644
index 0000000..2a14221
--- /dev/null
+++ b/aero-dav/src/synctypes.rs
@@ -0,0 +1,86 @@
+use super::types as dav;
+use super::versioningtypes as vers;
+
+// RFC 6578
+// https://datatracker.ietf.org/doc/html/rfc6578
+
+#[derive(Debug, PartialEq, Clone)]
+pub enum PropertyRequest {
+ SyncToken,
+}
+
+#[derive(Debug, PartialEq, Clone)]
+pub enum Property {
+ SyncToken(SyncToken),
+}
+
+#[derive(Debug, PartialEq, Clone)]
+pub enum ReportTypeName {
+ SyncCollection,
+}
+
+#[derive(Debug, PartialEq, Clone)]
+pub struct Multistatus {
+ pub sync_token: SyncToken,
+}
+
+//@FIXME add SyncToken to Multistatus
+
+/// Name: sync-collection
+///
+/// Namespace: DAV:
+///
+/// Purpose: WebDAV report used to synchronize data between client and
+/// server.
+///
+/// Description: See Section 3.
+///
+/// <!ELEMENT sync-collection (sync-token, sync-level, limit?, prop)>
+///
+/// <!-- DAV:limit defined in RFC 5323, Section 5.17 -->
+/// <!-- DAV:prop defined in RFC 4918, Section 14.18 -->
+
+#[derive(Debug, PartialEq, Clone)]
+pub struct SyncCollection<E: dav::Extension> {
+ pub sync_token: SyncTokenRequest,
+ pub sync_level: SyncLevel,
+ pub limit: Option<vers::Limit>,
+ pub prop: dav::PropName<E>,
+}
+
+/// Name: sync-token
+///
+/// Namespace: DAV:
+///
+/// Purpose: The synchronization token provided by the server and
+/// returned by the client.
+///
+/// Description: See Section 3.
+///
+/// <!ELEMENT sync-token CDATA>
+///
+/// <!-- Text MUST be a URI -->
+/// Used by multistatus
+#[derive(Debug, PartialEq, Clone)]
+pub struct SyncToken(pub String);
+
+/// Used by propfind and report sync-collection
+#[derive(Debug, PartialEq, Clone)]
+pub enum SyncTokenRequest {
+ InitialSync,
+ IncrementalSync(String),
+}
+
+/// Name: sync-level
+///
+/// Namespace: DAV:
+///
+/// Purpose: Indicates the "scope" of the synchronization report
+/// request.
+///
+/// Description: See Section 3.3.
+#[derive(Debug, PartialEq, Clone)]
+pub enum SyncLevel {
+ One,
+ Infinite,
+}