sasl/
error.rs

1use alloc::string::String;
2#[cfg(feature = "scram")]
3use getrandom::Error as RngError;
4
5/// A wrapper enum for things that could go wrong in this crate.
6#[derive(Debug)]
7pub enum Error {
8    #[cfg(feature = "scram")]
9    /// An error while initializing the Rng.
10    RngError(RngError),
11    /// An error in a SASL mechanism.
12    SaslError(String),
13}
14
15#[cfg(feature = "scram")]
16impl From<RngError> for Error {
17    fn from(err: RngError) -> Error {
18        Error::RngError(err)
19    }
20}