diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-29 10:14:51 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-29 10:14:51 +0200 |
commit | b9ce5886033677f6c65a4b873e17574fdb8df31d (patch) | |
tree | 9ed1d721361027d7d6fef0ecad65d7e1b74a7ddb /aero-dav/src/versioningtypes.rs | |
parent | 0dcf69f180f5a7b71b6ad2ac67e4cdd81e5154f1 (diff) | |
parent | 5954de6efbb040b8b47daf0c7663a60f3db1da6e (diff) | |
download | aerogramme-b9ce5886033677f6c65a4b873e17574fdb8df31d.tar.gz aerogramme-b9ce5886033677f6c65a4b873e17574fdb8df31d.zip |
Merge branch 'caldav'
Diffstat (limited to 'aero-dav/src/versioningtypes.rs')
-rw-r--r-- | aero-dav/src/versioningtypes.rs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/aero-dav/src/versioningtypes.rs b/aero-dav/src/versioningtypes.rs new file mode 100644 index 0000000..1f8d1cf --- /dev/null +++ b/aero-dav/src/versioningtypes.rs @@ -0,0 +1,59 @@ +use super::types as dav; + +//@FIXME required for a full DAV implementation +// See section 7.1 of the CalDAV RFC +// It seems it's mainly due to the fact that the REPORT method is re-used. +// https://datatracker.ietf.org/doc/html/rfc4791#section-7.1 +// +// Defines (required by CalDAV): +// - REPORT method +// - expand-property root report method +// +// Defines (required by Sync): +// - limit, nresults +// - supported-report-set + +// This property identifies the reports that are supported by the +// resource. +// +// <!ELEMENT supported-report-set (supported-report*)> +// <!ELEMENT supported-report report> +// <!ELEMENT report ANY> +// ANY value: a report element type + +#[derive(Debug, PartialEq, Clone)] +pub enum PropertyRequest { + SupportedReportSet, +} + +#[derive(Debug, PartialEq, Clone)] +pub enum Property<E: dav::Extension> { + SupportedReportSet(Vec<SupportedReport<E>>), +} + +#[derive(Debug, PartialEq, Clone)] +pub struct SupportedReport<E: dav::Extension>(pub ReportName<E>); + +#[derive(Debug, PartialEq, Clone)] +pub enum ReportName<E: dav::Extension> { + VersionTree, + ExpandProperty, + Extension(E::ReportTypeName), +} + +#[derive(Debug, PartialEq, Clone)] +pub enum Report<E: dav::Extension> { + VersionTree, // Not yet implemented + ExpandProperty, // Not yet implemented + Extension(E::ReportType), +} + +/// Limit +/// <!ELEMENT limit (nresults) > +#[derive(Debug, PartialEq, Clone)] +pub struct Limit(pub NResults); + +/// NResults +/// <!ELEMENT nresults (#PCDATA) > +#[derive(Debug, PartialEq, Clone)] +pub struct NResults(pub u64); |