compression

Crates.iocompression
lib.rscompression
version0.1.5
sourcesrc
created_at2018-03-23 06:25:57.948726
updated_at2019-11-15 11:26:15.580762
descriptionCompression libraries implemented by pure Rust.
homepage
repositoryhttps://github.com/chalharu/rust-compression
max_upload_size
id57018
size1,869,564
(chalharu)

documentation

https://docs.rs/rust-compression/

README

compression

crates.io badge Build Status docs.rs Coverage Status

Compression libraries implemented by pure Rust.

[dependencies]
compression = "0.1"

Features

  • deflate - Enabled by default.

  • gzip - Enabled by default.

  • zlib - Enabled by default.

  • bzip2 - Enabled by default.

  • lzhuf - Disabled by default.

  • lzss - Enabled by default.

  • std - By default, compression depends on libstd. However, it can be configured to use the unstable liballoc API instead, for use on platforms that have liballoc but not libstd. This configuration is currently unstable and is not guaranteed to work on all versions of Rust. To depend on compression without libstd, use default-features = false in the compression section of Cargo.toml to disable its "std" feature.

Examples

use compression::prelude::*;

fn main() {
    let compressed = b"aabbaabbaabbaabb\n"
        .into_iter()
        .cloned()
        .encode(&mut BZip2Encoder::new(9), Action::Finish)
        .collect::<Result<Vec<_>, _>>()
        .unwrap();

    let decompressed = compressed
        .iter()
        .cloned()
        .decode(&mut BZip2Decoder::new())
        .collect::<Result<Vec<_>, _>>()
        .unwrap();
}
Commit count: 91

cargo fmt