xmpp-rs-mirror/sasl/src/error.rs

20 lines
465 B
Rust
Raw Normal View History

#[cfg(feature = "scram")]
2019-01-17 22:53:29 +00:00
use rand_os::rand_core::Error as RngError;
2017-02-27 15:08:09 +00:00
/// A wrapper enum for things that could go wrong in this crate.
2017-02-27 15:08:09 +00:00
#[derive(Debug)]
pub enum Error {
#[cfg(feature = "scram")]
2019-01-17 22:53:29 +00:00
/// An error while initializing the Rng.
RngError(RngError),
/// An error in a SASL mechanism.
2017-02-27 15:08:09 +00:00
SaslError(String),
}
#[cfg(feature = "scram")]
2019-01-17 22:53:29 +00:00
impl From<RngError> for Error {
fn from(err: RngError) -> Error {
Error::RngError(err)
2017-02-27 15:08:09 +00:00
}
}