pub struct ModelRetryPolicy { /* private fields */ }Expand description
Explicit same-route retry and backoff authority.
Implementations§
Source§impl ModelRetryPolicy
impl ModelRetryPolicy
Sourcepub fn exponential(
max_attempts: u32,
initial_backoff: Duration,
max_backoff: Duration,
multiplier: u32,
) -> Result<Self, ModelRetryPolicyError>
pub fn exponential( max_attempts: u32, initial_backoff: Duration, max_backoff: Duration, multiplier: u32, ) -> Result<Self, ModelRetryPolicyError>
Creates an exponential policy. max_attempts includes the first call.
§Errors
Returns ModelRetryPolicyError for a zero attempt count, zero
multiplier, or inverted delay range.
Sourcepub const fn jitter(self, jitter: RetryJitter) -> Self
pub const fn jitter(self, jitter: RetryJitter) -> Self
Sets retry jitter.
Sourcepub fn allow_unknown(self, kind: ModelErrorKind) -> Self
pub fn allow_unknown(self, kind: ModelErrorKind) -> Self
Allows retry for one error kind whose retry safety is unknown.
This is explicit authority to risk another provider charge. It never overrides cancellation or an error marked unsafe.
Sourcepub const fn max_attempts(&self) -> u32
pub const fn max_attempts(&self) -> u32
Returns the total attempt bound, including the initial attempt.
Sourcepub const fn initial_backoff(&self) -> Duration
pub const fn initial_backoff(&self) -> Duration
Returns the initial exponential delay.
Sourcepub const fn max_backoff(&self) -> Duration
pub const fn max_backoff(&self) -> Duration
Returns the delay cap.
Sourcepub const fn multiplier(&self) -> u32
pub const fn multiplier(&self) -> u32
Returns the integer exponential multiplier.
Sourcepub const fn jitter_mode(&self) -> RetryJitter
pub const fn jitter_mode(&self) -> RetryJitter
Returns the configured jitter mode.
Trait Implementations§
Source§impl Clone for ModelRetryPolicy
impl Clone for ModelRetryPolicy
Source§fn clone(&self) -> ModelRetryPolicy
fn clone(&self) -> ModelRetryPolicy
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 ModelRetryPolicy
impl Debug for ModelRetryPolicy
Source§impl Default for ModelRetryPolicy
impl Default for ModelRetryPolicy
impl Eq for ModelRetryPolicy
Source§impl PartialEq for ModelRetryPolicy
impl PartialEq for ModelRetryPolicy
impl StructuralPartialEq for ModelRetryPolicy
Auto Trait Implementations§
impl Freeze for ModelRetryPolicy
impl RefUnwindSafe for ModelRetryPolicy
impl Send for ModelRetryPolicy
impl Sync for ModelRetryPolicy
impl Unpin for ModelRetryPolicy
impl UnsafeUnpin for ModelRetryPolicy
impl UnwindSafe for ModelRetryPolicy
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