pub struct ReqwestClient { /* private fields */ }Expand description
A shared reqwest client. Built once per process (the connection pool
is the Client); cheap to Arc, clone-free on the hot path.
Implementations§
Source§impl ReqwestClient
impl ReqwestClient
Sourcepub fn new() -> Self
pub fn new() -> Self
The hardened client: loopback, private and metadata destinations refused, default concurrency budget.
§Panics
Only if the rustls backend cannot initialize, which a static
webpki-roots configuration cannot do at runtime — a startup-time
invariant, the same class as core’s HmacSigner::new panic.
Sourcepub fn with_options(options: OutboundOptions) -> Self
pub fn with_options(options: OutboundOptions) -> Self
The client with explicit hardening knobs — see OutboundOptions.
Zero permits are clamped to one: a never-serving client is a
misconfiguration, not a mode.
§Panics
Trait Implementations§
Source§impl Default for ReqwestClient
impl Default for ReqwestClient
Source§impl HttpClient for ReqwestClient
impl HttpClient for ReqwestClient
Source§fn send<'life0, 'async_trait>(
&'life0 self,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends
request and returns the fully-buffered response under the
bounds this port carries: the body is at most
MAX_RESPONSE_BYTES unless an HttpPolicy tightens it, the
exchange is bounded by that policy’s deadline
(enforced through BoundedHttpClient on runtimes that wrap),
the destination is vetted where real sockets are opened, and a
runtime that keeps a concurrency budget holds one for the send.Auto Trait Implementations§
impl !RefUnwindSafe for ReqwestClient
impl !UnwindSafe for ReqwestClient
impl Freeze for ReqwestClient
impl Send for ReqwestClient
impl Sync for ReqwestClient
impl Unpin for ReqwestClient
impl UnsafeUnpin for ReqwestClient
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