Skip to main content

Module compression

Module compression 

Source
Expand description

Compression module providing automatic compression and decompression capabilities for Valkey Glide client operations.

Modules§

lz4_backend
zstd_backend

Structs§

CompressionConfig
CompressionManager

Enums§

CommandCompressionBehavior
CompressionBackendType
CompressionError
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§

CompressionBackend

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

Type Aliases§

CompressionResult