1
0
mirror of https://gitlab.com/xmpp-rs/xmpp-rs.git synced 2024-06-26 17:08:26 +02:00
xmpp-rs/sasl/src/error.rs

20 lines
465 B
Rust
Raw Normal View History

#[cfg(feature = "scram")]
2019-01-17 23:53:29 +01:00
use rand_os::rand_core::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")]
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")]
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
}
}