1use core::fmt::{self, Display, Formatter};
2
3#[derive(Debug, PartialEq, Eq)]
5pub enum OptionLockError {
6 FillState,
8 Unavailable,
10}
11
12impl Display for OptionLockError {
13 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
14 f.write_str(match self {
15 Self::FillState => "OptionLockError(FillState)",
16 Self::Unavailable => "OptionLockError(Unavailable)",
17 })
18 }
19}
20
21#[cfg(feature = "std")]
22impl ::std::error::Error for OptionLockError {}
23
24#[derive(Debug, PartialEq, Eq)]
26pub enum MutexLockError {
27 Poisoned,
29 Unavailable,
31}
32
33impl Display for MutexLockError {
34 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
35 f.write_str(match self {
36 Self::Poisoned => "MutexLockError(Poisoned)",
37 Self::Unavailable => "MutexLockError(Unavailable)",
38 })
39 }
40}
41
42#[cfg(feature = "std")]
43impl ::std::error::Error for MutexLockError {}
44
45#[derive(Debug, PartialEq, Eq)]
47pub struct PoisonError;
48
49impl Display for PoisonError {
50 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
51 f.write_str("PoisonError")
52 }
53}
54
55#[cfg(feature = "std")]
56impl ::std::error::Error for PoisonError {}