1use std::error;
2use std::fmt;
3
4#[derive(PartialEq, Eq, Clone, Copy)]
8pub enum ThreadPoolError {
9 ThreadsLost,
11
12 ValueError,
14}
15
16impl fmt::Debug for ThreadPoolError {
17 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18 match self {
19 ThreadPoolError::ThreadsLost => "ThreadPoolError::ThreadsLost".fmt(f),
20 ThreadPoolError::ValueError => "ThreadPoolError::ValueError".fmt(f),
21 }
22 }
23}
24
25impl fmt::Display for ThreadPoolError {
26 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27 match self {
28 ThreadPoolError::ThreadsLost => "thread pool lost".fmt(f),
29 ThreadPoolError::ValueError => "cannot set thread pool size to 0".fmt(f),
30 }
31 }
32}
33
34impl error::Error for ThreadPoolError {}