Trait tor_error::HasRetryTime

source ·
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§

source

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§

source

fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime
where F: FnOnce() -> Duration, Self: Sized,

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.

Implementors§