oauth2

Trait AsyncHttpClient

Source
pub trait AsyncHttpClient<'c> {
    type Error: Error + 'static;
    type Future: Future<Output = Result<HttpResponse, Self::Error>> + 'c;

    // Required method
    fn call(&'c self, request: HttpRequest) -> Self::Future;
}
Expand description

An asynchronous (future-based) HTTP client.

Required Associated Types§

Source

type Error: Error + 'static

Error type returned by HTTP client.

Source

type Future: Future<Output = Result<HttpResponse, Self::Error>> + 'c

Future type returned by HTTP client.

Required Methods§

Source

fn call(&'c self, request: HttpRequest) -> Self::Future

Perform a single HTTP request.

Implementations on Foreign Types§

Source§

impl<'c> AsyncHttpClient<'c> for Client

Source§

type Error = HttpClientError<Error>

Source§

type Future = Pin<Box<dyn Future<Output = Result<Response<Vec<u8>>, <Client as AsyncHttpClient<'c>>::Error>> + Send + Sync + 'c>>

Source§

fn call(&'c self, request: HttpRequest) -> Self::Future

Implementors§

Source§

impl<'c, E, F, T> AsyncHttpClient<'c> for T
where E: Error + 'static, F: Future<Output = Result<HttpResponse, E>> + 'c, T: Fn(HttpRequest) -> F,

Source§

type Error = E

Source§

type Future = F