pub trait AfterMiddleware:
Send
+ Sync
+ 'static {
// Provided methods
fn after(
&self,
_: &mut Request<'_, '_>,
res: Response,
) -> IronResult<Response> { ... }
fn catch(
&self,
_: &mut Request<'_, '_>,
err: IronError,
) -> IronResult<Response> { ... }
}Expand description
AfterMiddleware are fired after a Handler is called inside of a Chain.
AfterMiddleware receive both a Request and a Response and are responsible for doing
any response post-processing.
AfterMiddleware should not overwrite the contents of a Response. In
the common case, a complete response is generated by the Chain’s Handler and
AfterMiddleware simply do post-processing of that Response, such as
adding headers or logging.