pub trait FailurePolicy {
    fn record_success(&mut self);
    fn mark_dead_on_failure(&mut self) -> Option<Duration>;
    fn revived(&mut self);

    fn or_else<R>(self, rhs: R) -> OrElse<Self, R>
    where
        Self: Sized
, { ... } }
Expand description

A FailurePolicy is used to determine whether or not the backend died.

Required Methods

Invoked when a request is successful.

Invoked when a non-probing request fails. If it returns Some(Duration), the backend will mark as the dead for the specified Duration.

Invoked when a backend is revived after probing. Used to reset any history.

Provided Methods

Creates a FailurePolicy which uses both self and rhs.

Implementors