#[non_exhaustive]pub struct CommonRestConfig {
pub connect_timeout: Duration,
pub request_timeout: Duration,
pub tcp_keepalive: Duration,
pub max_retries: u32,
pub retry_backoff_bounds: (Duration, Duration),
}Expand description
Configuration of timeouts and retries for basic http client, with sane defaults
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.connect_timeout: DurationFail if we can’t connect in this amount of time
request_timeout: DurationFail if we don’t get a response in this amount of time
tcp_keepalive: DurationSetting for tcp keepalive interval
max_retries: u32Max retries for transient or 5xx type errors
retry_backoff_bounds: (Duration, Duration)Bounds for the exponential backoff retry policy
Implementations§
Source§impl CommonRestConfig
impl CommonRestConfig
Sourcepub fn apply_to_builder(
&self,
builder: ClientBuilder,
) -> Result<ClientWithMiddlewareBuilder, Error>
pub fn apply_to_builder( &self, builder: ClientBuilder, ) -> Result<ClientWithMiddlewareBuilder, Error>
Apply settings from CommonRestConfig to a reqwest::ClientBuilder (which may already have other options set). Then build a ClientWithMiddleware builder, attach configured RetryTransientMiddleware, and return the builder. Further middleware may then be attached, and build may be called.
Trait Implementations§
Source§impl Clone for CommonRestConfig
impl Clone for CommonRestConfig
Source§fn clone(&self) -> CommonRestConfig
fn clone(&self) -> CommonRestConfig
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 moreSource§impl Debug for CommonRestConfig
impl Debug for CommonRestConfig
Auto Trait Implementations§
impl Freeze for CommonRestConfig
impl RefUnwindSafe for CommonRestConfig
impl Send for CommonRestConfig
impl Sync for CommonRestConfig
impl Unpin for CommonRestConfig
impl UnsafeUnpin for CommonRestConfig
impl UnwindSafe for CommonRestConfig
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