From 6a5e39c60ad74c1cba84daa7c845c8f0237a5d28 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Mon, 19 Jun 2023 19:23:54 +0100 Subject: implement starttls --- src/stanza/mod.rs | 1 + src/stanza/stream.rs | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/stanza/mod.rs create mode 100644 src/stanza/stream.rs (limited to 'src/stanza') 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, + #[serde(rename = "@id")] + id: Option, + #[serde(rename = "@to")] + to: Option, + #[serde(rename = "@version")] + version: Option, + #[serde(rename = "@xml:lang")] + lang: Option, + #[serde(rename = "@xmlns")] + namespace: Option, + #[serde(rename = "@xmlns:stream")] + stream_namespace: Option, +} + +#[derive(Deserialize, Debug)] +#[serde(rename = "stream:features")] +pub struct StreamFeatures { + #[serde(rename = "$value")] + pub features: Vec, +} + +#[derive(Deserialize, PartialEq, Debug)] +pub enum StreamFeature { + #[serde(rename = "starttls")] + StartTls, + // TODO: other stream features + Sasl, + Bind, +} -- cgit