xml use tuple structs

This commit is contained in:
Lennart
2025-01-05 17:06:15 +01:00
parent 2eb6b1934d
commit 9ea9beb143
17 changed files with 57 additions and 141 deletions

View File

@@ -9,13 +9,8 @@ use actix_web::{
use quick_xml::name::Namespace;
use rustical_xml::{XmlRootTag, XmlSerialize, XmlSerializeRoot};
// Intermediate struct because of a serde limitation, see following article:
// https://stackoverflow.com/questions/78444158/unsupportedcannot-serialize-enum-newtype-variant-exampledata
#[derive(XmlSerialize)]
pub struct PropTagWrapper<T: XmlSerialize> {
#[xml(flatten, ty = "untagged")]
pub prop: Vec<T>,
}
pub struct PropTagWrapper<T: XmlSerialize>(#[xml(flatten, ty = "untagged")] pub Vec<T>);
// RFC 2518
// <!ELEMENT propstat (prop, status, responsedescription?) >