Crate zstd [] [src]

Rust binding to the zstd library.

This crate provides:

  • An encoder to compress data using zstd and send the output to another write.
  • A decoder to read input data from a Read and decompress it.

Example

extern crate zstd;

use std::io;

fn main() {
    // Uncompress input and print the result.
    let mut decoder = zstd::Decoder::new(io::stdin()).unwrap();
    io::copy(&mut decoder, &mut io::stdout()).unwrap();
}

Modules

dict

Train a dictionary from various sources.

Structs

Decoder

A decoder that decompress input data from another Read.

Encoder

An encoder that compress and forward data to another writer.

Functions

compress

Compress a single block of data to the given destination buffer.

compress_to_vec

Compress a block of data, and return the compressed result in a Vec<u8>.

decompress

Deompress a single block of data to the given destination buffer.

decompress_to_vec

Decompress a block of data, and return the decompressed result in a Vec<u8>.