Expand description
Compression module providing automatic compression and decompression capabilities for Valkey Glide client operations.
Modules§
Structs§
Enums§
- Command
Compression Behavior - Compression
Backend Type - Compression
Error - Detailed compression error with context for debugging
Constants§
- CURRENT_
VERSION - Current compression format version
- HEADER_
BACKEND_ INDEX - HEADER_
SIZE - Total header size: 3 bytes magic + 1 byte version + 1 byte backend_id
- HEADER_
VERSION_ INDEX - Index in header for version byte and backend_id
- MAGIC_
PREFIX - Magic prefix for compressed data headers (first 3 bytes)
- MIN_
COMPRESSED_ SIZE
Traits§
Functions§
- create_
header - Creates a compression header with the current version
- create_
header_ with_ version - Creates a compression header with a specific version This is useful for testing or supporting multiple versions
- decompress_
mget_ response - decompress_
single_ value_ response - extract_
backend_ id - Extracts the backend ID from the header Returns None if the data doesn’t have a valid magic header
- extract_
version - Extracts the version byte from the header Returns None if the data doesn’t have a valid magic header
- has_
current_ version_ header - Checks if the data has a valid magic header with the current version
- has_
magic_ header - Checks if data has a valid magic header (any version)
- process_
command_ args_ for_ compression - process_
response_ for_ decompression