Skip to main content

HttpClient

Trait HttpClient 

Source
pub trait HttpClient {
    type Response: HttpResponse;

    // Required method
    fn send(
        &self,
        method: HttpMethod,
        request: HttpRequest<'static>,
    ) -> impl Future<Output = Result<Self::Response, Error>> + Send + 'static + use<Self>;
}
Expand description

An HTTP client that can service spawn-safe query/write APIs through spawnable futures.

Required Associated Types§

Source

type Response: HttpResponse

The response type produced by this client for spawn-safe APIs.

Required Methods§

Source

fn send( &self, method: HttpMethod, request: HttpRequest<'static>, ) -> impl Future<Output = Result<Self::Response, Error>> + Send + 'static + use<Self>

Send a spawn-safe owned request.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl HttpClient for Client

Available on crate feature reqwest only.
Source§

type Response = Response

Source§

fn send( &self, method: HttpMethod, request: HttpRequest<'static>, ) -> impl Future<Output = Result<Self::Response, Error>> + Send + 'static + use<>

Implementors§