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.
Source§fn is_passthrough(
&self,
_request: &Request,
_connection: &ConnectionInfo,
) -> bool
fn is_passthrough( &self, _request: &Request, _connection: &ConnectionInfo, ) -> bool
Off, it does nothing: config-driven proxy routes keep their non-blocking forwarder (since 18.10.0, when the binary added this layer to proxy mode for the admin API’s maintenance switch).
fn handle( &self, request: &Request, connection: &ConnectionInfo, next: &dyn Application, ) -> Result<Response, String>
Source§fn answers_streamed_body(
&self,
_request: &Request,
_connection: &ConnectionInfo,
) -> bool
fn answers_streamed_body( &self, _request: &Request, _connection: &ConnectionInfo, ) -> bool
true when this layer answers request itself — it doesn’t call
next — and reads its body as a stream (a proxy forwarding it as it
arrives). The body is then streamed whatever the layers after it and
the application would say. Requires accepts_streamed_body. Since
18.3.0.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