1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
use crate::{
    async_trait,
    http::{Request, Response},
    Error,
};
pub use helper::Helper;
pub use response::{CookieError, ResponseExt};

// TODO: use T: AsyncRead as type of Request::Body
// TODO: use T: AsyncRead as type of Response::Body
#[async_trait]
pub trait HttpClient: Sync {
    type Err: Error;
    async fn request(&self, req: Request<Vec<u8>>) -> Result<Response<Vec<u8>>, Self::Err>;
    fn helper(&self) -> &Helper;
}

mod helper;
mod response;