net-relay 0.1.3

A set of types for network relay.
Documentation
#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("no pool")]
    NoPool,

    #[error("not match path")]
    NotMatchPath,

    #[error("no relay fn")]
    NoRelayFn,

    #[error("no bind address")]
    NoBindAddress,

    #[error("other error: {0}")]
    Other(Box<dyn std::error::Error + Sync + Send + 'static>),
}

impl Error {
    pub fn from_other<E: std::error::Error + Sync + Send + 'static>(e: E) -> Self {
        Error::Other(Box::new(e))
    }
}

impl From<std::io::Error> for Error {
    fn from(value: std::io::Error) -> Self {
        Error::from_other(value)
    }
}