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);