pub struct HttpClient { /* private fields */ }Expand description
Reusable HTTP stack: TLS config, proxy, and a dedicated current-thread Tokio runtime.
Several HttpInputs created from the same
client share the connection pool
and the runtime thread. The last drop shuts the runtime down.
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn builder() -> HttpClientBuilder
pub fn builder() -> HttpClientBuilder
Start a client builder (system roots, environment proxy).
Sourcepub fn input(&self, url: impl Into<String>) -> HttpInputBuilder
pub fn input(&self, url: impl Into<String>) -> HttpInputBuilder
Open an input that shares this client’s pool and runtime.
The input starts with this client’s response-header and body-idle
timeouts. HttpInputBuilder::timeouts can override those two per
input. Connect timeout is fixed when this client is built
(HttpClientBuilder::timeouts); reqwest applies it at client
construction, not per request.
Trait Implementations§
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HttpClient
impl !UnwindSafe for HttpClient
impl Freeze for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
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