https://github.com/gsquire/compress
Compression modifier for the Iron framework
https://github.com/gsquire/compress
iron rust
Last synced: 3 months ago
JSON representation
Compression modifier for the Iron framework
- Host: GitHub
- URL: https://github.com/gsquire/compress
- Owner: gsquire
- License: mit
- Created: 2015-05-13T22:22:20.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-04T01:02:44.000Z (over 8 years ago)
- Last Synced: 2025-04-15T00:08:24.807Z (3 months ago)
- Topics: iron, rust
- Language: Rust
- Homepage: https://crates.io/crates/iron_compress
- Size: 7.81 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# compress
[](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