http-compress 23.0.0

A high-performance async library for HTTP compression/decompression, supporting Brotli, Deflate, and Gzip algorithms. Provides both compression and decompression capabilities with optimized memory usage, ideal for HTTP clients/servers and network programming.
Documentation
1
2
3
4
5
6
7
8
use super::*;

thread_local! {
    /// Thread-local reusable raw DEFLATE compressor state.
    pub(crate) static DEFLATE_COMPRESSOR: RefCell<flate2::Compress> = RefCell::new(flate2::Compress::new(Compression::default(), false));
    /// Thread-local reusable raw DEFLATE decompressor state.
    pub(crate) static DEFLATE_DECOMPRESSOR: RefCell<Decompress> = RefCell::new(Decompress::new(false));
}