summaryrefslogtreecommitdiffstats
path: root/src/stanza/stream.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/stanza/stream.rs')
-rw-r--r--src/stanza/stream.rs36
1 files changed, 36 insertions, 0 deletions
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,
+}