Function warp::filters::compression::brotli[][src]

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

Example

use warp::Filter;

let route = warp::get()
    .and(warp::path::end())
    .and(warp::fs::file("./README.md"))
    .with(warp::compression::brotli());