pub struct RetryMiddleware<T: RetryPolicy + Send + Sync + 'static> { /* private fields */ }Expand description
The middleware is constructed with settings to handle a few different situations.
max_retries specifies the total number of attempts that will be made given a Retry-After header has been provided.
If no Retry-After header has been provided the configured policy will be used.
Should conditions for a retry be met but a retry interval failed to be determined the provided fallback_interval will be used.
Implementations§
Source§impl<T: RetryPolicy + Send + Sync + 'static> RetryMiddleware<T>
impl<T: RetryPolicy + Send + Sync + 'static> RetryMiddleware<T>
Trait Implementations§
Source§impl<T: Debug + RetryPolicy + Send + Sync + 'static> Debug for RetryMiddleware<T>
impl<T: Debug + RetryPolicy + Send + Sync + 'static> Debug for RetryMiddleware<T>
Source§impl Default for RetryMiddleware<ExponentialBackoff>
impl Default for RetryMiddleware<ExponentialBackoff>
Source§impl<T: RetryPolicy + Send + Sync + 'static> Middleware for RetryMiddleware<T>
impl<T: RetryPolicy + Send + Sync + 'static> Middleware for RetryMiddleware<T>
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
req: Request,
client: Client,
next: Next<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
req: Request,
client: Client,
next: Next<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asynchronously handle the request, and return a response.
Auto Trait Implementations§
impl<T> Freeze for RetryMiddleware<T>where
T: Freeze,
impl<T> RefUnwindSafe for RetryMiddleware<T>where
T: RefUnwindSafe,
impl<T> Send for RetryMiddleware<T>
impl<T> Sync for RetryMiddleware<T>
impl<T> Unpin for RetryMiddleware<T>where
T: Unpin,
impl<T> UnwindSafe for RetryMiddleware<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more