net-pool 0.5.1

A set of types for network connection pool.
Documentation
#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("pool is full")]
    PoolFull,

    #[error("no backend address")]
    NoBackend,

    #[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)
    }
}