xmpp-rs/sasl/src/error.rs
Emmanuel Gil Peyrot dc842c44d1 sasl: Make this crate no_std
We mostly had to import from alloc some structs that are part of the std
prelude, such as Vec and String.
2024-10-27 21:25:14 +01:00

20 lines
483 B
Rust

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)
}
}