pub struct MaintenanceLayer;Expand description
Middleware that returns 503 when MAINTENANCE_MODE is true.
Health probe paths (/healthz, /readyz) always pass through so that
load balancers can still detect the pod is alive.
Trait Implementations§
Source§impl Middleware for MaintenanceLayer
impl Middleware for MaintenanceLayer
Source§fn accepts_streamed_body(
&self,
_request: &Request,
_connection: &ConnectionInfo,
) -> bool
fn accepts_streamed_body( &self, _request: &Request, _connection: &ConnectionInfo, ) -> bool
Headers only: a streamed body passes through untouched.
Source§fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
In-memory only: safe on the event loop.
fn handle( &self, request: &Request, connection: &ConnectionInfo, next: &dyn Application, ) -> Result<Response, String>
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 MaintenanceLayer
impl RefUnwindSafe for MaintenanceLayer
impl Send for MaintenanceLayer
impl Sync for MaintenanceLayer
impl Unpin for MaintenanceLayer
impl UnsafeUnpin for MaintenanceLayer
impl UnwindSafe for MaintenanceLayer
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