message: Implement IntoElements.

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-29 03:50:20 +01:00
parent 4dc585f1c9
commit d824a161b6

View file

@ -1,7 +1,7 @@
use std::str::FromStr; use std::str::FromStr;
use minidom::Element; use minidom::{Element, IntoElements, IntoAttributeValue};
use minidom::IntoAttributeValue; use minidom::convert::ElementEmitter;
use jid::Jid; use jid::Jid;
@ -164,6 +164,13 @@ pub fn serialise(message: &Message) -> Element {
stanza stanza
} }
impl IntoElements for Message {
fn into_elements(self, emitter: &mut ElementEmitter) {
let elem = serialise(&self);
emitter.append_child(elem);
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::str::FromStr; use std::str::FromStr;