summaryrefslogtreecommitdiffstats
path: root/src/stanza
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-06-19 19:23:54 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-06-19 19:23:54 +0100
commit6a5e39c60ad74c1cba84daa7c845c8f0237a5d28 (patch)
tree7115e5dc2679bc053acb9b28fed41d3175ed2817 /src/stanza
parentabc3ffa7363ebd30101e15db7e02a7d44f323df9 (diff)
downloadluz-6a5e39c60ad74c1cba84daa7c845c8f0237a5d28.tar.gz
luz-6a5e39c60ad74c1cba84daa7c845c8f0237a5d28.tar.bz2
luz-6a5e39c60ad74c1cba84daa7c845c8f0237a5d28.zip
implement starttls
Diffstat (limited to '')
-rw-r--r--src/stanza/mod.rs1
-rw-r--r--src/stanza/stream.rs36
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,
+}