pub trait HttpClient:
'static
+ Send
+ Sync {
// Required methods
fn type_name(&self) -> &'static str;
fn user_agent(&self) -> Option<&HeaderValue>;
fn send(
&self,
req: Request<AsyncBody>,
) -> BoxFuture<'static, Result<Response<AsyncBody>>>;
fn proxy(&self) -> Option<&Url>;
// 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>>> { ... }
fn send_multipart_form<'a>(
&'a self,
_url: &str,
_request: Form,
) -> BoxFuture<'a, Result<Response<AsyncBody>>> { ... }
}Required Methods§
fn type_name(&self) -> &'static str
fn user_agent(&self) -> Option<&HeaderValue>
fn send( &self, req: Request<AsyncBody>, ) -> BoxFuture<'static, Result<Response<AsyncBody>>>
fn proxy(&self) -> Option<&Url>
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>>>
fn send_multipart_form<'a>( &'a self, _url: &str, _request: Form, ) -> BoxFuture<'a, Result<Response<AsyncBody>>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".