pub trait HttpClient:
'static
+ Send
+ Sync {
// Required methods
fn user_agent(&self) -> Option<&HeaderValue>;
fn proxy(&self) -> Option<&Url>;
fn send(
&self,
req: Request<AsyncBody>,
) -> BoxFuture<'static, Result<Response<AsyncBody>>>;
// Provided methods
fn get(
&self,
uri: &str,
body: AsyncBody,
follow_redirects: bool,
) -> BoxFuture<'static, Result<Response<AsyncBody>>> { ... }
fn post_json(
&self,
uri: &str,
body: AsyncBody,
) -> BoxFuture<'static, Result<Response<AsyncBody>>> { ... }
}Required Methods§
fn user_agent(&self) -> Option<&HeaderValue>
fn proxy(&self) -> Option<&Url>
fn send( &self, req: Request<AsyncBody>, ) -> BoxFuture<'static, Result<Response<AsyncBody>>>
Provided Methods§
fn get( &self, uri: &str, body: AsyncBody, follow_redirects: bool, ) -> BoxFuture<'static, Result<Response<AsyncBody>>>
fn post_json( &self, uri: &str, body: AsyncBody, ) -> BoxFuture<'static, Result<Response<AsyncBody>>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".