use core::fmt::{self, Display, Formatter};
#[derive(Debug, PartialEq, Eq)]
pub enum OptionLockError {
FillState,
Unavailable,
}
impl Display for OptionLockError {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::FillState => "OptionLockError(FillState)",
Self::Unavailable => "OptionLockError(Unavailable)",
})
}
}
#[cfg(feature = "std")]
impl ::std::error::Error for OptionLockError {}
#[derive(Debug, PartialEq, Eq)]
pub enum MutexLockError {
Poisoned,
Unavailable,
}
impl Display for MutexLockError {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::Poisoned => "MutexLockError(Poisoned)",
Self::Unavailable => "MutexLockError(Unavailable)",
})
}
}
#[cfg(feature = "std")]
impl ::std::error::Error for MutexLockError {}
#[derive(Debug, PartialEq, Eq)]
pub struct PoisonError;
impl Display for PoisonError {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str("PoisonError")
}
}
#[cfg(feature = "std")]
impl ::std::error::Error for PoisonError {}