pub struct RetryState {
pub attempt: usize,
pub max_attempts: usize,
pub delay_ms: u64,
pub history: Vec<ErrorHistoryEntry>,
}Expand description
Retry state for tracking retry attempts
Fields§
§attempt: usizeCurrent attempt number (1-indexed)
max_attempts: usizeMaximum attempts allowed
delay_ms: u64Delay between retries in milliseconds
history: Vec<ErrorHistoryEntry>Error history
Implementations§
Source§impl RetryState
impl RetryState
Sourcepub fn get_backoff_delay(&self) -> Duration
pub fn get_backoff_delay(&self) -> Duration
Get the delay for the next retry with exponential backoff
Calculates: delay_ms * 2^(attempt - 1)
Sourcepub fn record_error(&mut self, error: String)
pub fn record_error(&mut self, error: String)
Record an error and increment attempt counter
Sourcepub fn get_history(&self) -> &[ErrorHistoryEntry]
pub fn get_history(&self) -> &[ErrorHistoryEntry]
Get the error history
Trait Implementations§
Source§impl Clone for RetryState
impl Clone for RetryState
Source§fn clone(&self) -> RetryState
fn clone(&self) -> RetryState
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 moreAuto Trait Implementations§
impl Freeze for RetryState
impl RefUnwindSafe for RetryState
impl Send for RetryState
impl Sync for RetryState
impl Unpin for RetryState
impl UnwindSafe for RetryState
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