xmpp-rs/sasl/src/error.rs

22 lines
558 B
Rust
Raw Normal View History

#[cfg(feature = "scram")]
use getrandom::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")]
#[cfg_attr(docsrs, doc(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")]
#[cfg_attr(docsrs, doc(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
}
}