Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gsquire/compress

Compression modifier for the Iron framework
https://github.com/gsquire/compress

iron rust

Last synced: 30 days ago
JSON representation

Compression modifier for the Iron framework

Awesome Lists containing this project

README

        

# compress
[![Build Status](https://travis-ci.org/gsquire/compress.svg?branch=master)](https://travis-ci.org/gsquire/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.

### Documentation
Find it [here](https://docs.rs/iron_compress)

### Example
```rust
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 {
Ok(Response::with((status::Ok, GzipWriter(b"Some compressed response"))))
}

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

### License
MIT