pub struct LazyHttpClient(/* private fields */);Expand description
Builds at most one outbound client, and only if something needs it.
Reading the platform trust store and building a TLS configuration is real work, and a node that calls nothing out should not pay for it — nor should the tests covering those configurations. Callers ask for their own deadline and response ceiling, which are per-request and so cost nothing to vary; what they share is the connector underneath.
Implementations§
Source§impl LazyHttpClient
impl LazyHttpClient
Sourcepub fn with_limits(
&mut self,
request_timeout: Duration,
maximum_response_bytes: usize,
) -> Result<HttpClient, OutboundError>
pub fn with_limits( &mut self, request_timeout: Duration, maximum_response_bytes: usize, ) -> Result<HttpClient, OutboundError>
A client with the caller’s limits, over the shared connector.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LazyHttpClient
impl !UnwindSafe for LazyHttpClient
impl Forget for LazyHttpClient
impl Freeze for LazyHttpClient
impl Move for LazyHttpClient
impl Send for LazyHttpClient
impl Sync for LazyHttpClient
impl Unpin for LazyHttpClient
impl UnsafeUnpin for LazyHttpClient
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