disco: Add a helper constructor for Feature.

This commit is contained in:
Emmanuel Gil Peyrot 2019-01-27 17:18:58 +01:00
parent 376fa9f92e
commit ede2b08039

View file

@ -34,6 +34,15 @@ attributes: [
var: String = "var" => required, var: String = "var" => required,
]); ]);
impl Feature {
/// Create a new `<feature/>` with the according `@var`.
pub fn new(var: &str) -> Feature {
Feature {
var: String::from(var)
}
}
}
/// Structure representing an `<identity xmlns='http://jabber.org/protocol/disco#info'/>` element. /// Structure representing an `<identity xmlns='http://jabber.org/protocol/disco#info'/>` element.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Identity { pub struct Identity {