sasl/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use alloc::string::String;
#[cfg(feature = "scram")]
use getrandom::Error as RngError;

/// A wrapper enum for things that could go wrong in this crate.
#[derive(Debug)]
pub enum Error {
    #[cfg(feature = "scram")]
    /// An error while initializing the Rng.
    RngError(RngError),
    /// An error in a SASL mechanism.
    SaslError(String),
}

#[cfg(feature = "scram")]
impl From<RngError> for Error {
    fn from(err: RngError) -> Error {
        Error::RngError(err)
    }
}