pub struct RetryMiddleware { /* private fields */ }Expand description
Retry middleware wrapping the remainder of the chain in the estate’s
loop-retry backoff loop.
Defaults used by crate::ClientBuilder: 3 retries, 500ms initial
delay, 30s cap, jitter on.
Implementations§
Source§impl RetryMiddleware
impl RetryMiddleware
Sourcepub fn new(config: RetryConfig) -> Self
pub fn new(config: RetryConfig) -> Self
Create a retry middleware with the given loop-retry configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a retry middleware with loop_retry::RetryConfig::default()
(3 retries, 100ms initial, 5s cap, jitter on).
Trait Implementations§
Source§impl Clone for RetryMiddleware
impl Clone for RetryMiddleware
Source§impl Debug for RetryMiddleware
impl Debug for RetryMiddleware
Source§impl Middleware for RetryMiddleware
impl Middleware for RetryMiddleware
Source§fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handle the request, optionally calling
next to continue the chain.Auto Trait Implementations§
impl Freeze for RetryMiddleware
impl RefUnwindSafe for RetryMiddleware
impl Send for RetryMiddleware
impl Sync for RetryMiddleware
impl Unpin for RetryMiddleware
impl UnsafeUnpin for RetryMiddleware
impl UnwindSafe for RetryMiddleware
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