curl-http-client 2.5.2

This is a wrapper for Easy2 from curl-rust crate for ergonomic use and can perform synchronously and asynchronously using async-curl crate that uses an actor model (Message passing) to achieve a non-blocking I/O.
Documentation
use std::fmt::Debug;

use async_curl::dep::curl;

use crate::ExtendedHandler;

/// Error type returned by failed curl HTTP requests.
#[derive(Debug)]
pub enum Error<C>
where
    C: ExtendedHandler + Debug + Send + 'static,
{
    Curl(curl::Error),
    Http(String),
    Perform(async_curl::error::Error<C>),
    Other(String),
}

impl<C> std::fmt::Display for Error<C>
where
    C: ExtendedHandler + Debug + Send + 'static,
{
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::Curl(err) => write!(f, "{}", err),
            Error::Http(err) => write!(f, "{}", err),
            Error::Perform(err) => write!(f, "{}", err),
            Error::Other(err) => write!(f, "{}", err),
        }
    }
}

impl<C> std::error::Error for Error<C> where C: ExtendedHandler + Debug + Send + 'static {}