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>;
// Required method
fn wrap_http(&self, inner: S) -> Self::Service;
}Expand description
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.
Required Associated Types§
Sourcetype RequestBody: BufStream
type RequestBody: BufStream
The HTTP request body handled by the wrapped service.
Sourcetype ResponseBody: BufStream
type ResponseBody: BufStream
The HTTP response body returned by the wrapped service.
Sourcetype Service: HttpService<RequestBody = Self::RequestBody, ResponseBody = Self::ResponseBody, Error = Self::Error>
type Service: HttpService<RequestBody = Self::RequestBody, ResponseBody = Self::ResponseBody, Error = Self::Error>
The wrapped service.