pub struct RequestDecompressionLayer { /* private fields */ }
compression
only.Expand description
Decompresses request bodies and calls its underlying service.
Transparently decompresses request bodies based on the Content-Encoding
header.
When the encoding in the Content-Encoding
header is not accepted an Unsupported Media Type
status code will be returned with the accepted encodings in the Accept-Encoding
header.
Enabling pass-through of unaccepted encodings will not return an Unsupported Media Type
. But
will call the underlying service with the unmodified request if the encoding is not supported.
This is disabled by default.
See the module docs for more details.
Implementations§
Source§impl RequestDecompressionLayer
impl RequestDecompressionLayer
Sourcepub fn set_deflate(&mut self, enable: bool) -> &mut Self
pub fn set_deflate(&mut self, enable: bool) -> &mut Self
Sets whether to support Deflate encoding.
Sourcepub fn pass_through_unaccepted(self, enable: bool) -> Self
pub fn pass_through_unaccepted(self, enable: bool) -> Self
Sets whether to pass through the request even when the encoding is not supported.
Sourcepub fn set_pass_through_unaccepted(&mut self, enable: bool) -> &mut Self
pub fn set_pass_through_unaccepted(&mut self, enable: bool) -> &mut Self
Sets whether to pass through the request even when the encoding is not supported.
Trait Implementations§
Source§impl Clone for RequestDecompressionLayer
impl Clone for RequestDecompressionLayer
Source§fn clone(&self) -> RequestDecompressionLayer
fn clone(&self) -> RequestDecompressionLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RequestDecompressionLayer
impl Debug for RequestDecompressionLayer
Source§impl Default for RequestDecompressionLayer
impl Default for RequestDecompressionLayer
Source§fn default() -> RequestDecompressionLayer
fn default() -> RequestDecompressionLayer
Auto Trait Implementations§
impl Freeze for RequestDecompressionLayer
impl RefUnwindSafe for RequestDecompressionLayer
impl Send for RequestDecompressionLayer
impl Sync for RequestDecompressionLayer
impl Unpin for RequestDecompressionLayer
impl UnwindSafe for RequestDecompressionLayer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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