pub struct RetryMiddleware { /* private fields */ }Expand description
Retry middleware - retries failed requests with backoff Note: This is a marker - actual retry happens in handler execution layer
Implementations§
Source§impl RetryMiddleware
impl RetryMiddleware
pub fn new(policy: RetryPolicy) -> Self
pub fn with_max_attempts(max_attempts: u32) -> Self
pub fn policy(&self) -> &RetryPolicy
Trait Implementations§
Source§impl Middleware for RetryMiddleware
impl Middleware for RetryMiddleware
Source§fn on_error<'life0, 'async_trait>(
&'life0 self,
_request: Value,
error: Error,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_error<'life0, 'async_trait>(
&'life0 self,
_request: Value,
error: Error,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle errors from handler or downstream middleware
Auto Trait Implementations§
impl Freeze for RetryMiddleware
impl RefUnwindSafe for RetryMiddleware
impl Send for RetryMiddleware
impl Sync for RetryMiddleware
impl Unpin 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