deflate 0.7.2

A DEFLATE and zlib encoder written in safe rust.

Crate deflate [] [src]

An implementation an encoder using DEFLATE compression algorightm in pure rust.

This library provides functions to compress data using the DEFLATE algorithm, both with and without a zlib header/trailer. The current implementation is still a bit lacking speed-wise compared to C-libraries like zlib and miniz.

Examples:

Simple compression function:

use deflate::deflate_bytes;

let data = b"Some data";
let compressed = deflate_bytes(data);

Using a writer:

use std::io::Write;

use deflate::Compression;
use deflate::write::ZlibEncoder;

let data = b"This is some test data";
let mut encoder = ZlibEncoder::new(Vec::new(), Compression::Default);
encoder.write_all(data).unwrap();
let compressed_data = encoder.finish().unwrap();

Modules

write

Encoders implementing a Write interface.

Structs

CompressionOptions

A struct describing the options for a compressor or compression function.

Enums

Compression

An enum describing the level of compression to be used by the encoder

MatchingType

An enum describing whether we use lazy or greedy matching.

SpecialOptions

Enum allowing some special options (not implemented yet)!

Functions

deflate_bytes

Compress the given slice of bytes with DEFLATE compression using the default compression level.

deflate_bytes_conf

Compress the given slice of bytes with DEFLATE compression.

deflate_bytes_zlib

Compress the given slice of bytes with DEFLATE compression, including a zlib header and trailer, using the default compression level.

deflate_bytes_zlib_conf

Compress the given slice of bytes with DEFLATE compression, including a zlib header and trailer.