Trait tor_error::HasRetryTime
source · [−]pub trait HasRetryTime {
fn retry_time(&self) -> RetryTime;
fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime
where
F: FnOnce() -> Duration,
{ ... }
}
Expand description
Trait for an error object that can tell us when the operation which generated it can be retried.
Required Methods
fn 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
fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime where
F: FnOnce() -> Duration,
fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime where
F: FnOnce() -> Duration,
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
.