[][src]Crate async_compression

Adaptors between compression crates and Rust's modern asynchronous IO types.

Feature Organization

This crate is divided up along two axes, which can each be individually selected via Cargo features.

All features are default active, it's recommended you use this crate with default-features = false and enable just the features you need. (We're considering disabling this and shipping with no features active by default, please leave a comment if you have an opinion either way).

IO type

The first division is which underlying asynchronous IO type will be wrapped, these are available as two separate features that have corresponding top-level modules:

FeatureType
bufreadfutures::io::AsyncBufRead
writefutures::io::AsyncWrite
streamfutures::stream::Stream<Item = std::io::Result<bytes::Bytes>>

Compression implementation

The second division is which compression scheme to use, there are currently a few available choices, these determine which types will be available inside the above modules:

  • brotli
  • bzip
  • deflate
  • gzip
  • zlib
  • zstd

Modules

brotli2feature="brotli"

Types to configure brotli2 based encoders.

bufreadfeature="bufread"

Types which operate over AsyncBufRead streams, both encoders and decoders for various formats.

bzip2feature="bzip"

Types to configure bzip2 based encoders.

flate2feature="deflate" or feature="zlib" or feature="gzip"

Types to configure flate2 based encoders.

streamfeature="stream"

Types which operate over Stream<Item = io::Result<Bytes>> streams, both encoders and decoders for various formats.

writefeature="write"

Types which operate over AsyncWrite streams, both encoders and decoders for various formats.