pub fn auto(
method: &Method,
headers: &HeaderMap<HeaderValue>,
level: CompressionLevel,
resp: Response<Body>,
) -> Result<Response<Body>>Available on crate features
compression or compression-gzip or compression-brotli or compression-zstd or compression-deflate only.Expand description
Create a wrapping handler that compresses the Body of a hyper::Response
using gzip, deflate, brotli or zstd if is specified in the Accept-Encoding header, adding
content-encoding: <coding> to the Response’s HeaderMap.
It also provides the ability to apply compression for text-based MIME types only.