pub struct Client { /* private fields */ }Expand description
A Client is a simple client which sends a request and returns a response.
The connection timing, e.g. TCP/TLS overhead, will be inserted into the response if it exits.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new_connection(self, conn_type: ConnectionType) -> Self
pub fn new_connection(self, conn_type: ConnectionType) -> Self
Create a new connection for each request.
Sourcepub fn headers(self, headers: HeaderMap<HeaderValue>) -> Self
pub fn headers(self, headers: HeaderMap<HeaderValue>) -> Self
Set the headers for the upload or download request.
Sourcepub fn scoped_headers(self, scoped_headers: Option<ScopedHeaders>) -> Self
pub fn scoped_headers(self, scoped_headers: Option<ScopedHeaders>) -> Self
Set headers that are only attached when the request’s host matches the
scope’s allowlist. Headers set via Self::headers take precedence.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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