pub trait HttpTransport:
Send
+ Sync
+ 'static {
// Required method
fn send(&self, request: HttpRequest) -> SendFuture<'_>;
}Expand description
Sends HTTP requests for a provider.
Implementations return the response as soon as its status and headers are
known; the body streams afterwards (SSE responses are read incrementally).
A response with an error status is still Ok: classifying HTTP errors is
the provider’s job. Err means no response arrived.
Required Methods§
Sourcefn send(&self, request: HttpRequest) -> SendFuture<'_>
fn send(&self, request: HttpRequest) -> SendFuture<'_>
Send request.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: HttpTransport + ?Sized> HttpTransport for Arc<T>
impl<T: HttpTransport + ?Sized> HttpTransport for Arc<T>
fn send(&self, request: HttpRequest) -> SendFuture<'_>
Source§impl<T: HttpTransport + ?Sized> HttpTransport for Box<T>
impl<T: HttpTransport + ?Sized> HttpTransport for Box<T>
fn send(&self, request: HttpRequest) -> SendFuture<'_>
Implementors§
impl HttpTransport for ReplayTransport
impl HttpTransport for ReqwestTransport
Available on crate feature
reqwest only.