mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 07:02:24 +00:00
31 lines
906 B
Rust
31 lines
906 B
Rust
use rustical_xml::XmlDeserialize;
|
|
use rustical_xml::XmlRootTag;
|
|
|
|
#[derive(Debug, Clone, XmlDeserialize, XmlRootTag, PartialEq)]
|
|
#[xml(root = b"propfind", ns = "crate::namespace::NS_DAV")]
|
|
pub struct PropfindElement {
|
|
#[xml(ty = "untagged")]
|
|
pub prop: PropfindType,
|
|
}
|
|
|
|
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
|
|
pub struct PropElement<PN: XmlDeserialize = Propname>(#[xml(ty = "untagged", flatten)] pub Vec<PN>);
|
|
|
|
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
|
|
pub struct Propname {
|
|
#[xml(ty = "namespace")]
|
|
pub ns: Option<String>,
|
|
#[xml(ty = "tag_name")]
|
|
pub name: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
|
|
pub enum PropfindType<PN: XmlDeserialize = Propname> {
|
|
#[xml(ns = "crate::namespace::NS_DAV")]
|
|
Propname,
|
|
#[xml(ns = "crate::namespace::NS_DAV")]
|
|
Allprop,
|
|
#[xml(ns = "crate::namespace::NS_DAV")]
|
|
Prop(PropElement<PN>),
|
|
}
|