parsers: port more things to derive macros
This commit is contained in:
parent
93ba2797be
commit
2b346c4e87
18 changed files with 382 additions and 304 deletions
|
|
@ -38,18 +38,18 @@ impl Content {
|
|||
}
|
||||
}
|
||||
|
||||
generate_element!(
|
||||
/// A semantic group of contents.
|
||||
Group, "group", JINGLE_GROUPING,
|
||||
attributes: [
|
||||
/// Semantics of the grouping.
|
||||
semantics: Required<Semantics> = "semantics",
|
||||
],
|
||||
children: [
|
||||
/// List of contents that should be grouped with each other.
|
||||
contents: Vec<Content> = ("content", JINGLE_GROUPING) => Content
|
||||
]
|
||||
);
|
||||
/// A semantic group of contents.
|
||||
#[derive(FromXml, AsXml, PartialEq, Debug, Clone)]
|
||||
#[xml(namespace = ns::JINGLE_GROUPING, name = "group")]
|
||||
pub struct Group {
|
||||
/// Semantics of the grouping.
|
||||
#[xml(attribute)]
|
||||
pub semantics: Semantics,
|
||||
|
||||
/// List of contents that should be grouped with each other.
|
||||
#[xml(child(n = ..))]
|
||||
pub contents: Vec<Content>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
|
|
|||
Loading…
Reference in a new issue