parsers: port more elements to derive macros

This commit is contained in:
Jonas Schäfer 2024-06-29 16:34:27 +02:00
commit 0e4865006c
18 changed files with 405 additions and 274 deletions

View file

@ -137,18 +137,19 @@ impl PayloadType {
}
}
generate_element!(
/// Parameter related to a payload.
Parameter, "parameter", JINGLE_RTP,
attributes: [
/// The name of the parameter, from the list at
/// <https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml>
name: Required<String> = "name",
/// Parameter related to a payload.
#[derive(FromXml, IntoXml, PartialEq, Debug, Clone)]
#[xml(namespace = ns::JINGLE_RTP, name = "parameter")]
pub struct Parameter {
/// The name of the parameter, from the list at
/// <https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml>
#[xml(attribute)]
pub name: String,
/// The value of this parameter.
value: Required<String> = "value",
]
);
/// The value of this parameter.
#[xml(attribute)]
pub value: String,
}
#[cfg(test)]
mod tests {