pub struct DeflateMiddleware { /* private fields */ }Expand description
Deflate all response bodies
Implementations§
Source§impl DeflateMiddleware
impl DeflateMiddleware
Sourcepub fn new(level: Compression) -> DeflateMiddleware
pub fn new(level: Compression) -> DeflateMiddleware
Create a new DeflateMiddleware instance
Trait Implementations§
Source§impl Debug for DeflateMiddleware
impl Debug for DeflateMiddleware
Source§impl<S, RequestBody, ResponseBody> Middleware<S> for DeflateMiddleware
impl<S, RequestBody, ResponseBody> Middleware<S> for DeflateMiddleware
Source§type Response = Response<CompressStream<ResponseBody>>
type Response = Response<CompressStream<ResponseBody>>
The wrapped service response type
Source§type Service = DeflateService<S>
type Service = DeflateService<S>
The wrapped service
Auto Trait Implementations§
impl Freeze for DeflateMiddleware
impl RefUnwindSafe for DeflateMiddleware
impl Send for DeflateMiddleware
impl Sync for DeflateMiddleware
impl Unpin for DeflateMiddleware
impl UnwindSafe for DeflateMiddleware
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, S, B1, B2> HttpMiddleware<S> for Twhere
T: Middleware<S, Request = Request<B1>, Response = Response<B2>>,
B1: BufStream,
B2: BufStream,
impl<T, S, B1, B2> HttpMiddleware<S> for Twhere
T: Middleware<S, Request = Request<B1>, Response = Response<B2>>,
B1: BufStream,
B2: BufStream,
Source§type RequestBody = B1
type RequestBody = B1
The HTTP request body handled by the wrapped service.
Source§type ResponseBody = B2
type ResponseBody = B2
The HTTP response body returned by the wrapped service.
Source§type Error = <T as Middleware<S>>::Error
type Error = <T as Middleware<S>>::Error
The wrapped service’s error type.
Source§type Service = <T as Middleware<S>>::Service
type Service = <T as Middleware<S>>::Service
The wrapped service.
Source§fn wrap_http(&self, inner: S) -> <T as HttpMiddleware<S>>::Service
fn wrap_http(&self, inner: S) -> <T as HttpMiddleware<S>>::Service
Wrap the given service with the middleware, returning a new servicee
that has been decorated with the middleware.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more