iron_compress 0.1.0

A modifier for Iron that can compress response bodies
docs.rs failed to build iron_compress-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: iron_compress-0.1.3

compress

This small library exposes two types that know how to encode bytes based on the GZIP and deflate algorithms. The types implement the modifier trait so they can be used in an Iron Response.

Example

extern crate iron;
extern crate iron_compress;

use iron::prelude::*;
use iron::status;

use iron_compress::GzipWriter;

fn main() {
    fn hello_world(_: &mut Request) -> IronResult<Response> {
        Ok(Response::with((status::Ok, GzipWriter(b"Some compressed response"))))
    }

    Iron::new(hello_world).http("localhost:3000").unwrap();
}

License

MIT