pub struct HttpServiceOptions {
pub request_timeout: Duration,
pub connect_timeout: Duration,
}Expand description
Tunables for the shared HttpService client.
All values are Durations applied via reqwest’s timeout (whole request)
and connect_timeout (TCP+TLS establishment). Callers can still override
the overall timeout per request with .timeout() on the returned builder.
HttpModule registers a service with these defaults. To inject a tuned
instance instead, build it with HttpService::from_options and register
the value (this wins over the module’s default provider):
let mut registry = ProviderRegistry::new();
let options = HttpServiceOptions {
request_timeout: std::time::Duration::from_secs(5),
..Default::default()
};
registry.register_use_value::<HttpService>(Arc::new(HttpService::from_options(&options)));Fields§
§request_timeout: DurationWhole-request deadline (connect + writes + reads + body). Default
DEFAULT_REQUEST_TIMEOUT.
connect_timeout: DurationTCP/TLS establishment deadline. Default DEFAULT_CONNECT_TIMEOUT.
Trait Implementations§
Source§impl Clone for HttpServiceOptions
impl Clone for HttpServiceOptions
Source§impl Debug for HttpServiceOptions
impl Debug for HttpServiceOptions
Auto Trait Implementations§
impl Freeze for HttpServiceOptions
impl RefUnwindSafe for HttpServiceOptions
impl Send for HttpServiceOptions
impl Sync for HttpServiceOptions
impl Unpin for HttpServiceOptions
impl UnsafeUnpin for HttpServiceOptions
impl UnwindSafe for HttpServiceOptions
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