Skip to main content

HttpClientAdapter

Trait HttpClientAdapter 

Source
pub trait HttpClientAdapter {
    type Error;

    // Required method
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Vec<u8>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Adapter to allow different HTTP clients to be used to issue an HTTP request. To properly implement this trait, use async_trait.

Required Associated Types§

Source

type Error

Error type used by the underlying HTTP library

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, request: Request<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = Result<Response<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the specified URL using the specified request method

Returns the text contents of the resource located at the indicated URL

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§