diff options
Diffstat (limited to 'src/stanza')
-rw-r--r-- | src/stanza/mod.rs | 1 | ||||
-rw-r--r-- | src/stanza/stream.rs | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/stanza/mod.rs b/src/stanza/mod.rs new file mode 100644 index 0000000..baf29e0 --- /dev/null +++ b/src/stanza/mod.rs @@ -0,0 +1 @@ +pub mod stream; diff --git a/src/stanza/stream.rs b/src/stanza/stream.rs new file mode 100644 index 0000000..dde741d --- /dev/null +++ b/src/stanza/stream.rs @@ -0,0 +1,36 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize)] +#[serde(rename = "stream:stream")] +struct Stream { + #[serde(rename = "@from")] + from: Option<String>, + #[serde(rename = "@id")] + id: Option<String>, + #[serde(rename = "@to")] + to: Option<String>, + #[serde(rename = "@version")] + version: Option<f32>, + #[serde(rename = "@xml:lang")] + lang: Option<String>, + #[serde(rename = "@xmlns")] + namespace: Option<String>, + #[serde(rename = "@xmlns:stream")] + stream_namespace: Option<String>, +} + +#[derive(Deserialize, Debug)] +#[serde(rename = "stream:features")] +pub struct StreamFeatures { + #[serde(rename = "$value")] + pub features: Vec<StreamFeature>, +} + +#[derive(Deserialize, PartialEq, Debug)] +pub enum StreamFeature { + #[serde(rename = "starttls")] + StartTls, + // TODO: other stream features + Sasl, + Bind, +} |