Struct hyper_middleware::middleware::Chain
source · pub struct Chain { /* private fields */ }
Expand description
The middleware chain which can append other middlewares.
This is a canonical implementation of Iron’s middleware system, but Iron’s infrastructure is flexible enough to allow alternate systems.
Implementations
sourceimpl Chain
impl Chain
sourcepub fn link<B, A>(&mut self, link: (B, A)) -> &mut Chainwhere
A: AfterMiddleware,
B: BeforeMiddleware,
pub fn link<B, A>(&mut self, link: (B, A)) -> &mut Chainwhere
A: AfterMiddleware,
B: BeforeMiddleware,
Link both a before and after middleware to the chain at once.
Middleware that have a Before and After piece should have a constructor which returns both as a tuple, so it can be passed directly to link.
sourcepub fn link_before<B>(&mut self, before: B) -> &mut Chainwhere
B: BeforeMiddleware,
pub fn link_before<B>(&mut self, before: B) -> &mut Chainwhere
B: BeforeMiddleware,
Link a BeforeMiddleware
to the Chain
, after all previously linked
BeforeMiddleware
s.
sourcepub fn link_after<A>(&mut self, after: A) -> &mut Chainwhere
A: AfterMiddleware,
pub fn link_after<A>(&mut self, after: A) -> &mut Chainwhere
A: AfterMiddleware,
Link a AfterMiddleware
to the Chain
, after all previously linked
AfterMiddleware
s.
sourcepub fn link_around<A>(&mut self, around: A) -> &mut Chainwhere
A: AroundMiddleware,
pub fn link_around<A>(&mut self, around: A) -> &mut Chainwhere
A: AroundMiddleware,
Apply an AroundMiddleware
to the Handler
in this Chain
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Chain
impl Send for Chain
impl Sync for Chain
impl Unpin for Chain
impl !UnwindSafe for Chain
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more