pub trait Middleware<S>: 'static {
    fn start(&self, req: &HttpRequest<S>) -> Result<Started> { ... }
    fn response(
        &self,
        req: &HttpRequest<S>,
        resp: HttpResponse
    ) -> Result<Response> { ... } fn finish(&self, req: &HttpRequest<S>, resp: &HttpResponse) -> Finished { ... } }
Expand description

Middleware definition

Provided Methods

Method is called when request is ready. It may return future, which should resolve before next middleware get called.

Method is called when handler returns response, but before sending http message to peer.

Method is called after body stream get sent to peer.

Implementors