1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use super::*;
macro_rules! impl_error {
($name:ident) => {
impl Display for $name {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
<Self as Debug>::fmt(&self, f)
}
}
impl std::error::Error for $name {}
};
}
#[derive(Debug)]
pub struct NotSupported;
impl_error!(NotSupported);
#[derive(Debug)]
pub struct InvalidEnum(pub i32, pub &'static str);
impl_error!(InvalidEnum);
#[derive(Debug)]
pub struct RecvCreateError;
impl_error!(RecvCreateError);
#[derive(Debug)]
pub struct FindCreateError;
impl_error!(FindCreateError);
#[derive(Debug)]
pub struct SendCreateError;
impl_error!(SendCreateError);
#[derive(Debug)]
pub struct FindSourcesTimeout;
impl_error!(FindSourcesTimeout);