Crate zlib_rs
A pure-rust implementation of zlib.
This is a low-level implementation crate for use in libraries like flate2 and rustls. For a more high-level interface, use flate2.
For a zlib -compatible rust api of this crate, see libz-rs-sys. For instructions on integrating zlib-rs into a C library, see libz-rs-sys-cdylib.
Example
use ReturnCode;
use ;
use ;
let input = b"Hello World";
// --- compress ---
let mut compressed_buf = vec!;
let =
compress_slice;
assert_eq!;
// --- decompress ---
let mut decompressed_buf = vec!;
let =
decompress_slice;
assert_eq!;
assert_eq!;
Modules
Structs
- Deflate The state that is used to compress an input.
- DeflateConfig Configuration for compression.
- Inflate The state that is used to decompress an input.
- InflateConfig Configuration for decompresssion.
Enums
- DeflateError Errors that can occur when compressing.
- DeflateFlush
- InflateError Errors that can occur when decompressing.
- InflateFlush
- Method
- ReturnCode
- Status Possible status results of compressing some data or successfully decompressing a block of data.
- Strategy
Functions
-
compress_bound
Returns the upper bound on the compressed size for an input of
source_lenbytes. -
compress_slice
Compresses
inputinto the providedoutputbuffer. -
decompress_slice
Decompresses
inputinto the providedoutputbuffer.