diff options
author | cel 🌸 <cel@blos.sm> | 2023-06-19 19:23:54 +0100 |
---|---|---|
committer | cel 🌸 <cel@blos.sm> | 2023-06-19 19:23:54 +0100 |
commit | 6a5e39c60ad74c1cba84daa7c845c8f0237a5d28 (patch) | |
tree | 7115e5dc2679bc053acb9b28fed41d3175ed2817 /src/stanza | |
parent | abc3ffa7363ebd30101e15db7e02a7d44f323df9 (diff) | |
download | luz-6a5e39c60ad74c1cba84daa7c845c8f0237a5d28.tar.gz luz-6a5e39c60ad74c1cba84daa7c845c8f0237a5d28.tar.bz2 luz-6a5e39c60ad74c1cba84daa7c845c8f0237a5d28.zip |
implement starttls
Diffstat (limited to '')
-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, +} |