pub struct EarlyHintsLayer { /* private fields */ }Expand description
Middleware that sends the same Link hints for every request, then
hands it on.
Implementations§
Source§impl EarlyHintsLayer
impl EarlyHintsLayer
Trait Implementations§
Source§impl Clone for EarlyHintsLayer
impl Clone for EarlyHintsLayer
Source§impl Debug for EarlyHintsLayer
impl Debug for EarlyHintsLayer
Source§impl Middleware for EarlyHintsLayer
impl Middleware for EarlyHintsLayer
Source§fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
Queueing a hint never blocks.
fn handle( &self, request: &Request, connection: &ConnectionInfo, next: &dyn Application, ) -> Result<Response, String>
Source§fn accepts_streamed_body(
&self,
_request: &Request,
_connection: &ConnectionInfo,
) -> bool
fn accepts_streamed_body( &self, _request: &Request, _connection: &ConnectionInfo, ) -> bool
true when this layer never reads request.body, so the inner
application may receive it as a stream (Application::streams_body).
A layer that inspects the body (CSRF tokens in a form, request
signatures, rewriting) must keep the default false: it would see an
empty body.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.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 EarlyHintsLayer
impl RefUnwindSafe for EarlyHintsLayer
impl Send for EarlyHintsLayer
impl Sync for EarlyHintsLayer
impl Unpin for EarlyHintsLayer
impl UnsafeUnpin for EarlyHintsLayer
impl UnwindSafe for EarlyHintsLayer
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