HttpClient

Trait HttpClient 

Source
pub trait HttpClient {
    // Required method
    fn get<U: IntoUrl + Send + Sync>(
        &self,
        url: U,
    ) -> impl Future<Output = Result<impl Stream<Item = Result<Bytes>> + Send + Sync + Unpin>> + Send + Sync;
}
Expand description

Accesses the network over HTTP.

Required Methods§

Source

fn get<U: IntoUrl + Send + Sync>( &self, url: U, ) -> impl Future<Output = Result<impl Stream<Item = Result<Bytes>> + Send + Sync + Unpin>> + Send + Sync

Makes an HTTP GET request to url. Returns a stream of response body bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HttpClient for Client

Source§

async fn get<U: IntoUrl + Send + Sync>( &self, url: U, ) -> Result<impl Stream<Item = Result<Bytes>> + Unpin>

Implementors§