http-compress 23.4.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
9
10
use super::*;

thread_local! {
    /// Thread-local typed buffer pool reused across Brotli encode and decode operations.
    pub(crate) static BROTLI_BUFFER_POOL: RefCell<BrotliBufferPool> = RefCell::new(BrotliBufferPool::default());
    /// Thread-local reusable scratch buffer for Brotli streaming encode output.
    pub(crate) static BROTLI_ENCODE_SCRATCH: RefCell<[u8; BROTLI_ENCODE_SCRATCH_LEN]> = const { RefCell::new([0u8; BROTLI_ENCODE_SCRATCH_LEN]) };
    /// Thread-local reusable scratch buffer for Brotli streaming decode output.
    pub(crate) static BROTLI_DECODE_SCRATCH: RefCell<[u8; BROTLI_DECODE_SCRATCH_LEN]> = const { RefCell::new([0u8; BROTLI_DECODE_SCRATCH_LEN]) };
}