Skip to main content

HttpClient

Trait HttpClient 

Source
pub trait HttpClient: Send + Sync {
    // Required method
    fn fetch<'a>(
        &'a self,
        url: &'a str,
        timeout: Duration,
    ) -> BoxFuture<'a, Result<HttpResponse, WebFetchError>>;
}
Expand description

Trait for HTTP clients that can fetch web content

Required Methods§

Source

fn fetch<'a>( &'a self, url: &'a str, timeout: Duration, ) -> BoxFuture<'a, Result<HttpResponse, WebFetchError>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§