Struct backoff_tower::Backoff

source ·
pub struct Backoff<R> { /* private fields */ }
Expand description

Request wrapper to track the number of retries of the request

Trait Implementations§

source§

impl<P, Req, Res, Err> Policy<Backoff<Req>, Res, Err> for BackoffPolicy<P>where P: Policy<Req, Res, Err>,

§

type Future = IntoBackOffPolicyFut<<P as Policy<Req, Res, Err>>::Future>

The Future type returned by Policy::retry.
source§

fn retry( &self, req: &Backoff<Req>, result: Result<&Res, &Err> ) -> Option<Self::Future>

Check the policy if a certain request should be retried. Read more
source§

fn clone_request(&self, req: &Backoff<Req>) -> Option<Backoff<Req>>

Tries to clone a request before being passed to the inner service. Read more
source§

impl<S, B, Req> Service<Backoff<Req>> for BackoffInnerService<S, B>where S: Service<Req>, B: BackoffStrategy,

§

type Response = <S as Service<Req>>::Response

Responses given by the service.
§

type Error = <S as Service<Req>>::Error

Errors produced by the service.
§

type Future = BackoffFut<<S as Service<Req>>::Future>

The future response value.
source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call(&mut self, req: Backoff<Req>) -> Self::Future

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

§

impl<R> RefUnwindSafe for Backoff<R>where R: RefUnwindSafe,

§

impl<R> Send for Backoff<R>where R: Send,

§

impl<R> Sync for Backoff<R>where R: Sync,

§

impl<R> Unpin for Backoff<R>where R: Unpin,

§

impl<R> UnwindSafe for Backoff<R>where R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.