[−][src]Struct iron::middleware::Chain
The middleware chain used in Iron.
This is a canonical implementation of Iron's middleware system, but Iron's infrastructure is flexible enough to allow alternate systems.
Methods
impl Chain
[src]
pub fn new<H: Handler>(handler: H) -> Chain
[src]
Construct a new ChainBuilder from a Handler
.
pub fn link<B, A>(&mut self, link: (B, A)) -> &mut Chain where
A: AfterMiddleware,
B: BeforeMiddleware,
[src]
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.
pub fn link_before<B>(&mut self, before: B) -> &mut Chain where
B: BeforeMiddleware,
[src]
B: BeforeMiddleware,
Link a BeforeMiddleware
to the Chain
, after all previously linked
BeforeMiddleware
.
pub fn link_after<A>(&mut self, after: A) -> &mut Chain where
A: AfterMiddleware,
[src]
A: AfterMiddleware,
Link a AfterMiddleware
to the Chain
, after all previously linked
AfterMiddleware
.
pub fn around<A>(&mut self, around: A) -> &mut Chain where
A: AroundMiddleware,
[src]
A: AroundMiddleware,
Apply an AroundMiddleware
to the Handler
in this Chain
.
Note: This function is being renamed link_around()
, and will
eventually be removed.
pub fn link_around<A>(&mut self, around: A) -> &mut Chain where
A: AroundMiddleware,
[src]
A: AroundMiddleware,
Apply an AroundMiddleware
to the Handler
in this Chain
.
Trait Implementations
Auto Trait Implementations
impl Sync for Chain
impl Unpin for Chain
impl Send for Chain
impl !UnwindSafe for Chain
impl !RefUnwindSafe for Chain
Blanket Implementations
impl<F> Handler for F where
F: Send + Sync + 'static + Fn(&mut Request) -> Result<Response, IronError>,
[src]
F: Send + Sync + 'static + Fn(&mut Request) -> Result<Response, IronError>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> UnsafeAny for T where
T: Any,
T: Any,