mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
message: Implement IntoElements.
This commit is contained in:
parent
4dc585f1c9
commit
d824a161b6
1 changed files with 9 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::str::FromStr;
|
||||
|
||||
use minidom::Element;
|
||||
use minidom::IntoAttributeValue;
|
||||
use minidom::{Element, IntoElements, IntoAttributeValue};
|
||||
use minidom::convert::ElementEmitter;
|
||||
|
||||
use jid::Jid;
|
||||
|
||||
|
@ -164,6 +164,13 @@ pub fn serialise(message: &Message) -> Element {
|
|||
stanza
|
||||
}
|
||||
|
||||
impl IntoElements for Message {
|
||||
fn into_elements(self, emitter: &mut ElementEmitter) {
|
||||
let elem = serialise(&self);
|
||||
emitter.append_child(elem);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::str::FromStr;
|
||||
|
|
Loading…
Reference in a new issue