pub fn brotli() -> Compression<impl Fn(CompressionProps) -> Response + Copy>
Create a wrapping filter that compresses the Body of a Response using brotli, adding content-encoding: br to the Response’s HeaderMap
Response
content-encoding: br
HeaderMap
use warp::Filter; let route = warp::get() .and(warp::path::end()) .and(warp::fs::file("./README.md")) .with(warp::compression::brotli());