pub trait HttpClient: Send + Sync {
// Required methods
fn get(
&self,
url: Url,
) -> Box<dyn Future<Output = Result<Vec<u8>>> + Send + '_>;
fn post(
&self,
url: Url,
post_data: Vec<u8>,
) -> Box<dyn Future<Output = Result<()>> + Send + '_>;
}Expand description
Helper trait to encapsulate different HTTP clients.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl HttpClient for Client
Available on crate feature reqwest only.
impl HttpClient for Client
Available on crate feature
reqwest only.