ibb: Implement IntoAttributeValue for Stanza.
This commit is contained in:
parent
1b4c0c4589
commit
c71b32ae24
1 changed files with 10 additions and 1 deletions
11
src/ibb.rs
11
src/ibb.rs
|
|
@ -1,6 +1,6 @@
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use minidom::Element;
|
use minidom::{Element, IntoAttributeValue};
|
||||||
use base64;
|
use base64;
|
||||||
|
|
||||||
use error::Error;
|
use error::Error;
|
||||||
|
|
@ -32,6 +32,15 @@ impl FromStr for Stanza {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl IntoAttributeValue for Stanza {
|
||||||
|
fn into_attribute_value(self) -> Option<String> {
|
||||||
|
match self {
|
||||||
|
Stanza::Iq => None,
|
||||||
|
Stanza::Message => Some(String::from("message")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum IBB {
|
pub enum IBB {
|
||||||
Open {
|
Open {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue