Skip to main content

HttpTransport

Trait HttpTransport 

Source
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§

Source

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>

Source§

fn send(&self, request: HttpRequest) -> SendFuture<'_>

Source§

impl<T: HttpTransport + ?Sized> HttpTransport for Box<T>

Source§

fn send(&self, request: HttpRequest) -> SendFuture<'_>

Implementors§

Source§

impl HttpTransport for ReplayTransport

Source§

impl HttpTransport for ReqwestTransport

Available on crate feature reqwest only.