diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-20 13:15:56 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-20 13:15:56 +0100 |
commit | 3c2d4e69876f4e8af0e3fbf5efa774a2084be67e (patch) | |
tree | 3ceaf63121b3f18277706d26f0a594c3b1a4cae1 /aero-dav/src/caldecoder.rs | |
parent | 311bc59c1b35b748c1551a33480aaefd7cd50199 (diff) | |
download | aerogramme-3c2d4e69876f4e8af0e3fbf5efa774a2084be67e.tar.gz aerogramme-3c2d4e69876f4e8af0e3fbf5efa774a2084be67e.zip |
Refactor Multistatus builder to better integrate with REPORT
Diffstat (limited to 'aero-dav/src/caldecoder.rs')
-rw-r--r-- | aero-dav/src/caldecoder.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/aero-dav/src/caldecoder.rs b/aero-dav/src/caldecoder.rs index b124154..f92cf09 100644 --- a/aero-dav/src/caldecoder.rs +++ b/aero-dav/src/caldecoder.rs @@ -25,6 +25,22 @@ impl<E: dav::Extension> QRead<MkCalendarResponse<E>> for MkCalendarResponse<E> { } } +impl<E: dav::Extension> QRead<Report<E>> for Report<E> { + async fn qread(xml: &mut Reader<impl IRead>) -> Result<Self, ParsingError> { + match CalendarQuery::<E>::qread(xml).await { + Err(ParsingError::Recoverable) => (), + otherwise => return otherwise.map(Self::Query) + } + + match CalendarMultiget::<E>::qread(xml).await { + Err(ParsingError::Recoverable) => (), + otherwise => return otherwise.map(Self::Multiget), + } + + FreeBusyQuery::qread(xml).await.map(Self::FreeBusy) + } +} + impl<E: dav::Extension> QRead<CalendarQuery<E>> for CalendarQuery<E> { async fn qread(xml: &mut Reader<impl IRead>) -> Result<Self, ParsingError> { xml.open(CAL_URN, "calendar-query").await?; |