parsers: replace some more generate_element! calls with derive macros

This commit is contained in:
Jonas Schäfer 2024-06-30 09:42:55 +02:00
commit 819a869ffb
10 changed files with 317 additions and 165 deletions

View file

@ -93,19 +93,19 @@ pub struct Enabled {
pub resume: ResumeAttr,
}
generate_element!(
/// A stream management error happened.
Failed, "failed", SM,
attributes: [
/// The last handled stanza.
h: Option<u32> = "h",
],
children: [
/// The error returned.
// XXX: implement the * handling.
error: Option<DefinedCondition> = ("*", XMPP_STANZAS) => DefinedCondition
]
);
/// A stream management error happened.
#[derive(FromXml, AsXml, Debug, PartialEq, Clone)]
#[xml(namespace = ns::SM, name = "failed")]
pub struct Failed {
/// The last handled stanza.
#[xml(attribute)]
pub h: Option<u32>,
/// The error returned.
// XXX: implement the * handling.
#[xml(child(default))]
pub error: Option<DefinedCondition>,
}
/// Requests the currently received stanzas by the other party.
#[derive(FromXml, AsXml, PartialEq, Debug, Clone)]