pub struct HttpClient<Request, Response>where
Request: RequestHttpConvert<Request> + Clone + Send + 'static,
Response: ResponseHttpConvert<Request, Response> + Send + 'static,{ /* private fields */ }
Expand description
Client for HTTP communication with a remote host.
Implementations§
Source§impl<Request, Response> HttpClient<Request, Response>where
Request: RequestHttpConvert<Request> + Clone + Send + 'static,
Response: ResponseHttpConvert<Request, Response> + Send + 'static,
impl<Request, Response> HttpClient<Request, Response>where
Request: RequestHttpConvert<Request> + Clone + Send + 'static,
Response: ResponseHttpConvert<Request, Response> + Send + 'static,
Sourcepub fn new(
config: HttpClientConfig,
) -> Result<HttpClient<Request, Response>, InvalidUri>
pub fn new( config: HttpClientConfig, ) -> Result<HttpClient<Request, Response>, InvalidUri>
Creates a new client for HTTP communication. An InvalidUri
error will be returned if the base URL in the configuration is invalid.
Trait Implementations§
Source§impl<Request, Response> Clone for HttpClient<Request, Response>where
Request: Clone + RequestHttpConvert<Request> + Send + 'static,
Response: Clone + ResponseHttpConvert<Request, Response> + Send + 'static,
impl<Request, Response> Clone for HttpClient<Request, Response>where
Request: Clone + RequestHttpConvert<Request> + Send + 'static,
Response: Clone + ResponseHttpConvert<Request, Response> + Send + 'static,
Source§fn clone(&self) -> HttpClient<Request, Response>
fn clone(&self) -> HttpClient<Request, Response>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Request, Response> Service<Request> for HttpClient<Request, Response>where
Request: RequestHttpConvert<Request> + Clone + Send + Sync + 'static,
Response: ResponseHttpConvert<Request, Response> + Send + 'static,
impl<Request, Response> Service<Request> for HttpClient<Request, Response>where
Request: RequestHttpConvert<Request> + Clone + Send + Sync + 'static,
Response: ResponseHttpConvert<Request, Response> + Send + 'static,
Source§type Response = ServiceResponse<Response>
type Response = ServiceResponse<Response>
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<ServiceResponse<Response>, Box<dyn Error + Sync + Send>>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<ServiceResponse<Response>, Box<dyn Error + Sync + Send>>> + Send>>
The future response value.
Auto Trait Implementations§
impl<Request, Response> Freeze for HttpClient<Request, Response>
impl<Request, Response> !RefUnwindSafe for HttpClient<Request, Response>
impl<Request, Response> Send for HttpClient<Request, Response>
impl<Request, Response> Sync for HttpClient<Request, Response>
impl<Request, Response> Unpin for HttpClient<Request, Response>
impl<Request, Response> !UnwindSafe for HttpClient<Request, Response>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more