pub trait HttpClient: Send + Sync {
// Required methods
fn get(&self, url: &str) -> Result<HttpResponse>;
fn head(&self, url: &str) -> Result<HttpResponse>;
fn get_range(&self, url: &str, start: u64, end: u64) -> Result<HttpResponse>;
}Expand description
Trait for HTTP client operations.
This trait abstracts HTTP operations to allow for testing with mock
implementations. The real implementation uses reqwest, while tests can use
MockHttpClient.
Required Methods§
Sourcefn get(&self, url: &str) -> Result<HttpResponse>
fn get(&self, url: &str) -> Result<HttpResponse>
Performs an HTTP GET request.
Sourcefn head(&self, url: &str) -> Result<HttpResponse>
fn head(&self, url: &str) -> Result<HttpResponse>
Performs an HTTP HEAD request.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".