1 2 3 4 5 6 7 8 9 10 11 12 13
#[derive(Debug)] pub enum Error { Message(String), Other(Box<dyn std::error::Error>) } impl<T: std::error::Error + 'static> From<T> for Error { fn from(e: T) -> Self { Self::Other(Box::new(e)) } } pub type Result<T> = std::result::Result<T, Error>;