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, }