1
0
mirror of https://gitlab.com/xmpp-rs/xmpp-rs.git synced 2024-06-09 09:44:03 +02:00
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 16:08:09 +01:00
/// A wrapper enum for things that could go wrong in this crate.
2017-02-27 16:08:09 +01:00
#[derive(Debug)]
pub enum Error {
#[cfg(feature = "scram")]
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
2019-01-17 23:53:29 +01:00
/// An error while initializing the Rng.
RngError(RngError),
/// An error in a SASL mechanism.
2017-02-27 16:08:09 +01:00
SaslError(String),
}
#[cfg(feature = "scram")]
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
2019-01-17 23:53:29 +01:00
impl From<RngError> for Error {
fn from(err: RngError) -> Error {
Error::RngError(err)
2017-02-27 16:08:09 +01:00
}
}