pub trait HasRetryTime {
// Required method
fn retry_time(&self) -> RetryTime;
// Provided method
fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime
where F: FnOnce() -> Duration,
Self: Sized { ... }
}
Expand description
Trait for an error object that can tell us when the operation which generated it can be retried.
Required Methods§
Sourcefn retry_time(&self) -> RetryTime
fn retry_time(&self) -> RetryTime
Return the time when the operation that gave this error can be retried.
See all caveats and explanations on RetryTime
.
Provided Methods§
Sourcefn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime
fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime
Return an absolute retry when the operation that gave this error can be retried.
Requires that now
is the current time, and choose_delay
is a
function to choose a delay for RetryTime::AfterWaiting
.