Trait tower_web::util::http::HttpMiddleware[][src]

pub trait HttpMiddleware<S>: Sealed<S> {
    type RequestBody: BufStream;
    type ResponseBody: BufStream;
    type Error;
    type Service: HttpService<RequestBody = Self::RequestBody, ResponseBody = Self::ResponseBody, Error = Self::Error>;
    fn wrap_http(&self, inner: S) -> Self::Service;
}

HTTP middleware trait

A trait "alias" for Middleware where the yielded service is an HttpService.

Using HttpMiddleware in where bounds is easier than trying to use Middleware directly.

Associated Types

The HTTP request body handled by the wrapped service.

The HTTP response body returned by the wrapped service.

The wrapped service's error type.

The wrapped service.

Required Methods

Wrap the given service with the middleware, returning a new servicee that has been decorated with the middleware.

Implementors