Trait actix_web::middleware::Middleware [−][src]
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 { ... } }
Middleware definition
Provided Methods
fn start(&self, req: &HttpRequest<S>) -> Result<Started>
Method is called when request is ready. It may return future, which should resolve before next middleware get called.
fn response(&self, req: &HttpRequest<S>, resp: HttpResponse) -> Result<Response>
Method is called when handler returns response, but before sending http message to peer.
fn finish(&self, req: &HttpRequest<S>, resp: &HttpResponse) -> Finished
Method is called after body stream get sent to peer.
Implementors
impl<S> Middleware<S> for Logger
impl<S> Middleware<S> for Cors
impl<S> Middleware<S> for CsrfFilter
impl<S> Middleware<S> for DefaultHeaders
impl<S: 'static> Middleware<S> for ErrorHandlers<S>
impl<S: 'static, T: IdentityPolicy<S>> Middleware<S> for IdentityService<T>
impl<S: 'static, T: SessionBackend<S>> Middleware<S> for SessionStorage<T, S>