pub struct MirrorLayer { /* private fields */ }Expand description
A Mirror as middleware: copies the request, then hands it on.
Implementations§
Source§impl MirrorLayer
impl MirrorLayer
pub fn new(mirror: Mirror) -> MirrorLayer
Trait Implementations§
Source§impl Clone for MirrorLayer
impl Clone for MirrorLayer
Source§impl Debug for MirrorLayer
impl Debug for MirrorLayer
Source§impl Middleware for MirrorLayer
impl Middleware for MirrorLayer
Source§fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
fn runs_inline(&self, _request: &Request, _connection: &ConnectionInfo) -> bool
Queueing a copy never blocks.
Source§fn accepts_streamed_body(
&self,
_request: &Request,
_connection: &ConnectionInfo,
) -> bool
fn accepts_streamed_body( &self, _request: &Request, _connection: &ConnectionInfo, ) -> bool
A streamed body passes through untouched (and isn’t mirrored).
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.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 MirrorLayer
impl RefUnwindSafe for MirrorLayer
impl Send for MirrorLayer
impl Sync for MirrorLayer
impl Unpin for MirrorLayer
impl UnsafeUnpin for MirrorLayer
impl UnwindSafe for MirrorLayer
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