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§
Sourcetype Response: HttpResponse
type Response: HttpResponse
The response type produced by this client for spawn-safe APIs.
Required Methods§
Sourcefn send(
&self,
method: HttpMethod,
request: HttpRequest<'static>,
) -> impl Future<Output = Result<Self::Response, Error>> + Send + 'static + use<Self>
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.
impl HttpClient for Client
Available on crate feature
reqwest only.