pub struct MiddlewareChain { /* private fields */ }Expand description
A chain of middleware to be executed.
Implementations§
Source§impl MiddlewareChain
impl MiddlewareChain
Sourcepub fn add<M: Middleware + 'static>(&mut self, middleware: M)
pub fn add<M: Middleware + 'static>(&mut self, middleware: M)
Append a middleware to the chain. before hooks run in insertion
order; after hooks run in reverse (outermost-last).
Sourcepub async fn process_request(
&self,
request: &mut Request,
) -> Result<Outcome, WebError>
pub async fn process_request( &self, request: &mut Request, ) -> Result<Outcome, WebError>
Run every before hook in order. Returns Outcome::Continue if all
of them did; Outcome::Respond from the first that short-circuited
(the rest aren’t run); or the first Err.
Trait Implementations§
Source§impl Clone for MiddlewareChain
impl Clone for MiddlewareChain
Source§fn clone(&self) -> MiddlewareChain
fn clone(&self) -> MiddlewareChain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MiddlewareChain
impl Default for MiddlewareChain
Source§fn default() -> MiddlewareChain
fn default() -> MiddlewareChain
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for MiddlewareChain
impl !UnwindSafe for MiddlewareChain
impl Freeze for MiddlewareChain
impl Send for MiddlewareChain
impl Sync for MiddlewareChain
impl Unpin for MiddlewareChain
impl UnsafeUnpin for MiddlewareChain
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