diff --git a/parsers/src/sasl.rs b/parsers/src/sasl.rs index 588aa43d3d5937b759f9fe7caf7794506bcbc004..de4abb1bd0bdeddd7bf14a01c83f5d29f90690f6 100644 --- a/parsers/src/sasl.rs +++ b/parsers/src/sasl.rs @@ -163,6 +163,35 @@ pub struct Failure { pub texts: BTreeMap, } +/// Enum which allows parsing/serialising any SASL element. +#[derive(FromXml, AsXml, Debug, Clone)] +#[xml()] +pub enum Nonza { + /// Abortion of SASL transaction + #[xml(transparent)] + Abort(Abort), + + /// Failure of SASL transaction + #[xml(transparent)] + Failure(Failure), + + /// Success of SASL transaction + #[xml(transparent)] + Success(Success), + + /// Initiation of SASL transaction + #[xml(transparent)] + Auth(Auth), + + /// Challenge sent by the server to the client + #[xml(transparent)] + Challenge(Challenge), + + /// Response sent by the client to the server + #[xml(transparent)] + Response(Response), +} + #[cfg(test)] mod tests { use super::*;