use std::sync::{MutexGuard, PoisonError, TryLockError}; use derive_more::{Display, From}; use path::PathHandler; pub type Result = core::result::Result; #[derive(Debug, From, Display)] pub enum Error { #[from] Io(std::io::Error), MutexLock(String), MutexTryLock(String), PathSub, #[from] Toml(toml::de::Error), MissingPathHandler, } impl From>> for Error { fn from(value: PoisonError>) -> Self { Self::MutexLock(value.to_string()) } } impl From>> for Error { fn from(value: TryLockError>) -> Self { Self::MutexTryLock(value.to_string()) } }