use std::io; use toml; use crate::auth::SASLError; #[derive(Debug)] pub enum Error { TomlDe(toml::de::Error), TomlSer(toml::ser::Error), SASL(SASLError), IO(io::Error), Boxed(Box), } impl From for Error { fn from(e: SASLError) -> Error { Error::SASL(e) } } impl From for Error { fn from(e: io::Error) -> Error { Error::IO(e) } } impl From for Error { fn from(e: toml::de::Error) -> Error { Error::TomlDe(e) } } impl From for Error { fn from(e: toml::ser::Error) -> Error { Error::TomlSer(e) } } impl From> for Error { fn from(e: Box) -> Error { Error::Boxed(e) } } pub type Result = std::result::Result;