pub struct HttpRequestRetryOverride { /* private fields */ }Expand description
Per-request overrides for the client retry strategy.
This type allows callers to:
- force-enable retry even when client-level retry is disabled;
- force-disable retry for one request;
- override the retryable-method policy for one request;
- optionally honor
Retry-Afteron429 Too Many Requests.
Implementations§
Source§impl HttpRequestRetryOverride
impl HttpRequestRetryOverride
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty override that follows client-level retry settings.
§Returns
New HttpRequestRetryOverride with all per-request overrides disabled.
Sourcepub fn force_enable(self) -> Self
pub fn force_enable(self) -> Self
Enables force-retry for this request and clears force-disable.
§Returns
Updated override for chaining.
Sourcepub fn force_disable(self) -> Self
pub fn force_disable(self) -> Self
Enables force-disable for this request and clears force-enable.
§Returns
Updated override for chaining.
Sourcepub fn with_method_policy(self, policy: HttpRetryMethodPolicy) -> Self
pub fn with_method_policy(self, policy: HttpRetryMethodPolicy) -> Self
Sourcepub fn with_honor_retry_after(self, enabled: bool) -> Self
pub fn with_honor_retry_after(self, enabled: bool) -> Self
Sourcepub fn is_force_enable(&self) -> bool
pub fn is_force_enable(&self) -> bool
Returns whether force-enable is active for this request.
§Returns
true when retry is force-enabled at request level.
Sourcepub fn is_force_disable(&self) -> bool
pub fn is_force_disable(&self) -> bool
Returns whether force-disable is active for this request.
§Returns
true when retry is force-disabled at request level.
Sourcepub fn method_policy(&self) -> Option<HttpRetryMethodPolicy>
pub fn method_policy(&self) -> Option<HttpRetryMethodPolicy>
Returns the per-request method-policy override, if present.
§Returns
Optional override for HttpRetryMethodPolicy.
Sourcepub fn should_honor_retry_after(&self) -> bool
pub fn should_honor_retry_after(&self) -> bool
Returns whether Retry-After should be honored for this request.
§Returns
true when this request should honor Retry-After on 429.
Trait Implementations§
Source§impl Clone for HttpRequestRetryOverride
impl Clone for HttpRequestRetryOverride
Source§fn clone(&self) -> HttpRequestRetryOverride
fn clone(&self) -> HttpRequestRetryOverride
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpRequestRetryOverride
impl Debug for HttpRequestRetryOverride
Source§impl Default for HttpRequestRetryOverride
impl Default for HttpRequestRetryOverride
Source§fn default() -> HttpRequestRetryOverride
fn default() -> HttpRequestRetryOverride
Source§impl PartialEq for HttpRequestRetryOverride
impl PartialEq for HttpRequestRetryOverride
impl Eq for HttpRequestRetryOverride
impl StructuralPartialEq for HttpRequestRetryOverride
Auto Trait Implementations§
impl Freeze for HttpRequestRetryOverride
impl RefUnwindSafe for HttpRequestRetryOverride
impl Send for HttpRequestRetryOverride
impl Sync for HttpRequestRetryOverride
impl Unpin for HttpRequestRetryOverride
impl UnsafeUnpin for HttpRequestRetryOverride
impl UnwindSafe for HttpRequestRetryOverride
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.