diff options
Diffstat (limited to 'src/dav/encoder.rs')
-rw-r--r-- | src/dav/encoder.rs | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/dav/encoder.rs b/src/dav/encoder.rs index c0a5332..f3a1860 100644 --- a/src/dav/encoder.rs +++ b/src/dav/encoder.rs @@ -101,6 +101,20 @@ impl<E: Extension> QWrite for PropValue<E> { } } +/// Error response +impl<E: Extension> QWrite for Error<E> { + async fn qwrite(&self, xml: &mut Writer<impl IWrite>) -> Result<(), QError> { + let start = xml.create_dav_element("error"); + let end = start.to_end(); + + xml.q.write_event_async(Event::Start(start.clone())).await?; + for violation in &self.0 { + violation.qwrite(xml).await?; + } + xml.q.write_event_async(Event::End(end)).await + } +} + // --- XML inner elements impl<E: Extension> QWrite for PropertyUpdateItem<E> { async fn qwrite(&self, xml: &mut Writer<impl IWrite>) -> Result<(), QError> { @@ -584,19 +598,6 @@ impl QWrite for LockEntry { } } -impl<E: Extension> QWrite for Error<E> { - async fn qwrite(&self, xml: &mut Writer<impl IWrite>) -> Result<(), QError> { - let start = xml.create_dav_element("error"); - let end = start.to_end(); - - xml.q.write_event_async(Event::Start(start.clone())).await?; - for violation in &self.0 { - violation.qwrite(xml).await?; - } - xml.q.write_event_async(Event::End(end)).await - } -} - impl<E: Extension> QWrite for Violation<E> { async fn qwrite(&self, xml: &mut Writer<impl IWrite>) -> Result<(), QError> { let mut atom = async |c| { |