Skip to main content

HttpBackend

Trait HttpBackend 

Source
pub trait HttpBackend: Send + Sync {
    // Required methods
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        request: HttpRequest,
    ) -> Pin<Box<dyn Future<Output = Result<HttpResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute_stream<'life0, 'async_trait>(
        &'life0 self,
        request: HttpRequest,
    ) -> Pin<Box<dyn Future<Output = Result<HttpStreamingResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Pluggable HTTP transport used by Client.

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, request: HttpRequest, ) -> Pin<Box<dyn Future<Output = Result<HttpResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes one HTTP request and returns the fully buffered response.

Source

fn execute_stream<'life0, 'async_trait>( &'life0 self, request: HttpRequest, ) -> Pin<Box<dyn Future<Output = Result<HttpStreamingResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes one HTTP request and returns a streaming response body.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl HttpBackend for ServiceBackend

Available on crate feature tower only.
Source§

impl HttpBackend for RecordingBackend

Source§

impl HttpBackend for ReqwestBackend