Struct iron::middleware::Chain [] [src]

pub struct Chain {
    // some fields omitted
}

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

fn new<H: Handler>(handler: H) -> Chain

Construct a new ChainBuilder from a Handler.

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.

Link a BeforeMiddleware to the Chain, after all previously linked BeforeMiddleware.

Link a AfterMiddleware to the Chain, after all previously linked AfterMiddleware.

fn around<A>(&mut self, around: A) -> &mut Chain where A: AroundMiddleware

Apply an AroundMiddleware to the Handler in this Chain.

Note: This function is being renamed link_around(), and will eventually be removed.

Apply an AroundMiddleware to the Handler in this Chain.

Trait Implementations

impl Handler for Chain

fn handle(&self, req: &mut Request) -> IronResult<Response>