smp/error.rs
1use std::{error, fmt, result};
2
3#[derive(Debug, PartialEq)]
4pub enum Error {
5 Unknown,
6 PoisonError,
7}
8
9pub type Result<T> = result::Result<T, Error>;
10
11impl fmt::Display for Error {
12 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
13 write!(formatter, "{}", match self {
14 Error::Unknown => "unknown error",
15 Error::PoisonError => "poison error",
16 })
17 }
18}
19
20impl error::Error for Error {}
21