pub struct MiddlewarePipeline { /* private fields */ }Expand description
Middleware pipeline that composes multiple middleware in sequence
Implementations§
Source§impl MiddlewarePipeline
impl MiddlewarePipeline
Sourcepub fn add<M: Middleware + 'static>(self, middleware: M) -> Self
pub fn add<M: Middleware + 'static>(self, middleware: M) -> Self
Add middleware to the pipeline
Sourcepub async fn process_request(
&self,
request: Request,
) -> Result<Request, Response>
pub async fn process_request( &self, request: Request, ) -> Result<Request, Response>
Process request through all middleware in order
Sourcepub async fn process_response(&self, response: Response) -> Response
pub async fn process_response(&self, response: Response) -> Response
Process response through all middleware in reverse order
Trait Implementations§
Source§impl Default for MiddlewarePipeline
impl Default for MiddlewarePipeline
Source§fn default() -> MiddlewarePipeline
fn default() -> MiddlewarePipeline
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MiddlewarePipeline
impl !RefUnwindSafe for MiddlewarePipeline
impl Send for MiddlewarePipeline
impl Sync for MiddlewarePipeline
impl Unpin for MiddlewarePipeline
impl !UnwindSafe for MiddlewarePipeline
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more