aboutsummaryrefslogtreecommitdiff
path: root/aero-dav/src/versioningtypes.rs
blob: 1f8d1cf1ca91a3f2f8a6855167e4f8a092dbce81 (plain) (blame)
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
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);