body: Add a serialise function.
This commit is contained in:
parent
6d6ac8a380
commit
ca6e65ad76
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue