pub struct RetryLayer { /* private fields */ }Expand description
Retry middleware.
When the inner application returns a response whose status code is in the
configured list, the request is re-dispatched up to max_retries additional
times. If all attempts return a retryable status the last response is
returned as-is.
Implementations§
Source§impl RetryLayer
impl RetryLayer
Trait Implementations§
Source§impl Default for RetryLayer
impl Default for RetryLayer
Source§impl Middleware for RetryLayer
impl Middleware for RetryLayer
fn handle( &self, request: &Request, connection: &ConnectionInfo, next: &dyn Application, ) -> Result<Response, String>
Source§fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
true when this layer’s own work for request never blocks (in-memory
state, atomics, short mutexes) — see Application::runs_inline. A
WithMiddleware stack runs inline only if every layer and the inner
application agree. Default false.Source§fn is_passthrough(
&self,
_request: &Request,
_connection: &ConnectionInfo,
) -> bool
fn is_passthrough( &self, _request: &Request, _connection: &ConnectionInfo, ) -> bool
true when handle would do nothing for request but call next
(e.g. a rate limit that isn’t configured). A WithMiddleware stack
offers the inner application’s execute_async only if every layer
passes the request through. Default false.Auto Trait Implementations§
impl Freeze for RetryLayer
impl RefUnwindSafe for RetryLayer
impl Send for RetryLayer
impl Sync for RetryLayer
impl Unpin for RetryLayer
impl UnsafeUnpin for RetryLayer
impl UnwindSafe for RetryLayer
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