rustical_dav/xml/
propfind.rs1use rustical_xml::NamespaceOwned;
2use rustical_xml::XmlDeserialize;
3use rustical_xml::XmlRootTag;
4
5#[derive(Debug, Clone, XmlDeserialize, XmlRootTag, PartialEq)]
6#[xml(root = b"propfind", ns = "crate::namespace::NS_DAV")]
7pub struct PropfindElement {
8 #[xml(ty = "untagged")]
9 pub prop: PropfindType,
10}
11
12#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
13pub struct PropElement<PN: XmlDeserialize = Propname>(#[xml(ty = "untagged", flatten)] pub Vec<PN>);
14
15#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
16pub struct Propname {
17 #[xml(ty = "namespace")]
18 pub ns: Option<NamespaceOwned>,
19 #[xml(ty = "tag_name")]
20 pub name: String,
21}
22
23#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
24pub enum PropfindType<PN: XmlDeserialize = Propname> {
25 #[xml(ns = "crate::namespace::NS_DAV")]
26 Propname,
27 #[xml(ns = "crate::namespace::NS_DAV")]
28 Allprop,
29 #[xml(ns = "crate::namespace::NS_DAV")]
30 Prop(PropElement<PN>),
31}