parsers: port some elements with children to derive macros

This commit is contained in:
Jonas Schäfer 2024-06-29 16:14:12 +02:00
commit 5d284bbd3a
11 changed files with 106 additions and 117 deletions

View file

@ -105,16 +105,18 @@ pub struct Get {
pub url: String,
}
generate_element!(
/// Requesting a slot
SlotResult, "slot", HTTP_UPLOAD,
children: [
/// Put URL and headers
put: Required<Put> = ("put", HTTP_UPLOAD) => Put,
/// Get URL
get: Required<Get> = ("get", HTTP_UPLOAD) => Get
]
);
/// Requesting a slot
#[derive(FromXml, AsXml, Debug, Clone, PartialEq)]
#[xml(namespace = ns::HTTP_UPLOAD, name = "slot")]
pub struct SlotResult {
/// Put URL and headers
#[xml(child)]
pub put: Put,
/// Get URL
#[xml(child)]
pub get: Get,
}
impl IqResultPayload for SlotResult {}