fn finalize_request<'mw>(_req: &mut Request<Config>, mut res: Response<'mw, Config>) -> MiddlewareResult<'mw, Config> {
    let mut encoder = Encoder::new(Vec::new()).unwrap();
    res.set(MediaType::Json)
        .set(ContentEncoding(vec![Encoding::Gzip]));

    io::copy(&mut get_json(&res).as_bytes(), &mut encoder).unwrap();
    res.send(encoder.finish().into_result().unwrap())
}
/**
 * Finalize the request by putting it into the JSON format and compressing it
 * TODO: This can easily be expanded to support more output format based on req header
 */
Finalize the request by putting it into the JSON format and compressing it
TODO: This can easily be expanded to support more output format based on req header
Finalize the request by putting it into the JSON format and compressing it TODO : This can easily be expanded to support more output format based on req header
fn finalize_request<'mw>(_req: &mut Request<Config>, mut res: Response<'mw, Config>) -> MiddlewareResult<'mw, Config> {
    let mut encoder = Encoder::new(Vec::new()).unwrap();
    res.set(MediaType::Json)
        .set(ContentEncoding(vec![Encoding::Gzip]));
    io::copy(&mut get_json(&res).as_bytes(), &mut encoder).unwrap();
    res.send(encoder.finish().into_result().unwrap())
}
fn finalize_request < ' mw > ( _req : & mut Request < Config > , mut res : Response < ' mw , Config > ) -> MiddlewareResult < ' mw , Config > { let mut encoder = Encoder :: new ( Vec :: new ( ) ) . unwrap ( ) ; res . set ( MediaType :: Json ) . set ( ContentEncoding ( vec ! [ Encoding Gzip ] ) ) ; io :: copy ( & mut get_json ( & res ) . as_bytes ( ) , & mut encoder ) . unwrap ( ) ; res . send ( encoder . finish ( ) . into_result ( ) . unwrap ( ) ) }
Finalize the request by putting it into the JSON format and compressing it
 TODO: This can easily be expanded to support more output format based on req header
Finalize the request by putting it into the JSON format and compressing it TODO : This can easily be expanded to support more output format based on req header
_req
&mut Request<Config>
res
Response<'mw, Config>