pub struct DecompressionLayer { /* private fields */ }
Expand description
Decompresses response bodies of the underlying service.
This adds the Accept-Encoding
header to requests and transparently decompresses response
bodies based on the Content-Encoding
header.
See the module docs for more details.
Implementations§
Source§impl DecompressionLayer
impl DecompressionLayer
Sourcepub fn new() -> DecompressionLayer
pub fn new() -> DecompressionLayer
Creates a new DecompressionLayer
.
Sourcepub fn gzip(self, enable: bool) -> DecompressionLayer
pub fn gzip(self, enable: bool) -> DecompressionLayer
Sets whether to request the gzip encoding.
Sourcepub fn deflate(self, enable: bool) -> DecompressionLayer
pub fn deflate(self, enable: bool) -> DecompressionLayer
Sets whether to request the Deflate encoding.
Sourcepub fn br(self, enable: bool) -> DecompressionLayer
pub fn br(self, enable: bool) -> DecompressionLayer
Sets whether to request the Brotli encoding.
Sourcepub fn zstd(self, enable: bool) -> DecompressionLayer
pub fn zstd(self, enable: bool) -> DecompressionLayer
Sets whether to request the Zstd encoding.
Sourcepub fn no_gzip(self) -> DecompressionLayer
pub fn no_gzip(self) -> DecompressionLayer
Disables the gzip encoding.
This method is available even if the gzip
crate feature is disabled.
Sourcepub fn no_deflate(self) -> DecompressionLayer
pub fn no_deflate(self) -> DecompressionLayer
Disables the Deflate encoding.
This method is available even if the deflate
crate feature is disabled.
Sourcepub fn no_br(self) -> DecompressionLayer
pub fn no_br(self) -> DecompressionLayer
Disables the Brotli encoding.
This method is available even if the br
crate feature is disabled.
Sourcepub fn no_zstd(self) -> DecompressionLayer
pub fn no_zstd(self) -> DecompressionLayer
Disables the Zstd encoding.
This method is available even if the zstd
crate feature is disabled.
Trait Implementations§
Source§impl Clone for DecompressionLayer
impl Clone for DecompressionLayer
Source§fn clone(&self) -> DecompressionLayer
fn clone(&self) -> DecompressionLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more