pub struct RetryTracker {
pub path: PathBuf,
pub attempts: u32,
pub last_error: Option<String>,
}Expand description
Tracks retry state for a single file.
Fields§
§path: PathBufPath of the file being retried.
attempts: u32Number of attempts made so far.
last_error: Option<String>Last error message.
Implementations§
Source§impl RetryTracker
impl RetryTracker
Sourcepub fn record_failure(&mut self, error: &str)
pub fn record_failure(&mut self, error: &str)
Records a failed attempt.
Sourcepub fn can_retry(&self, config: &RetryConfig) -> bool
pub fn can_retry(&self, config: &RetryConfig) -> bool
Returns whether more retries are allowed given the config.
Sourcepub fn next_delay(&self, config: &RetryConfig) -> Duration
pub fn next_delay(&self, config: &RetryConfig) -> Duration
Returns the delay before the next retry.
Trait Implementations§
Source§impl Clone for RetryTracker
impl Clone for RetryTracker
Source§fn clone(&self) -> RetryTracker
fn clone(&self) -> RetryTracker
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 RetryTracker
impl RefUnwindSafe for RetryTracker
impl Send for RetryTracker
impl Sync for RetryTracker
impl Unpin for RetryTracker
impl UnsafeUnpin for RetryTracker
impl UnwindSafe for RetryTracker
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more