body: Add a serialise function.

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-23 02:24:13 +01:00
parent 6d6ac8a380
commit ca6e65ad76

View file

@ -17,6 +17,13 @@ pub fn parse_body(root: &Element) -> Result<Body, Error> {
Ok(root.text())
}
pub fn serialise(body: &Body) -> Element {
Element::builder("body")
.ns(ns::JABBER_CLIENT)
.append(body.to_owned())
.build()
}
#[cfg(test)]
mod tests {
use minidom::Element;