pub struct RetryContext {
pub max_attempts: u32,
pub initial_delay_ms: u64,
pub max_delay_ms: u64,
pub force_retry: bool,
pub method: Option<String>,
pub has_idempotency_key: bool,
}Expand description
Configuration for request retry behavior.
Fields§
§max_attempts: u32Maximum number of retry attempts (0 = disabled)
initial_delay_ms: u64Initial delay between retries in milliseconds
max_delay_ms: u64Maximum delay cap in milliseconds
force_retry: boolWhether to force retry on non-idempotent requests without idempotency key
method: Option<String>HTTP method (used to check idempotency)
has_idempotency_key: boolWhether an idempotency key is set
Implementations§
Source§impl RetryContext
impl RetryContext
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Returns true if retries are enabled.
Sourcepub fn is_safe_to_retry(&self) -> bool
pub fn is_safe_to_retry(&self) -> bool
Returns true if the request method is safe to retry (idempotent or has key).
Trait Implementations§
Source§impl Clone for RetryContext
impl Clone for RetryContext
Source§fn clone(&self) -> RetryContext
fn clone(&self) -> RetryContext
Returns a duplicate of the value. Read more
1.0.0 · 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 RetryContext
impl Debug for RetryContext
Auto Trait Implementations§
impl Freeze for RetryContext
impl RefUnwindSafe for RetryContext
impl Send for RetryContext
impl Sync for RetryContext
impl Unpin for RetryContext
impl UnsafeUnpin for RetryContext
impl UnwindSafe for RetryContext
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