Expand description
HPACK header compression for HTTP/2 (RFC 7541).
Implements the HPACK header compression algorithm used in HTTP/2 HEADERS frames. Includes:
- Static table (61 entries per RFC 7541 Appendix A)
- Dynamic table with eviction
- Integer encoding/decoding with N-bit prefix
- String literal encoding/decoding
- Huffman encoding/decoding (RFC 7541 Appendix B)
HpackDecoderandHpackEncodertypes
Structs§
- Hpack
Decoder - HPACK decoder with dynamic table state.
- Hpack
Encoder - HPACK encoder.
Constants§
- HUFFMAN_
TABLE - Full Huffman code table from RFC 7541 Appendix B. Index is the symbol value (0-255 for bytes, 256 for EOS). Each entry is (code: u32, nbits: u8).
- STATIC_
TABLE - Static HPACK table from RFC 7541 Appendix A. 61 entries, 1-indexed in the spec (index 0 here = spec index 1).
Functions§
- decode_
integer - Decode an HPACK integer with N-bit prefix.
- decode_
string - Decode a string literal from an HPACK-encoded buffer.
- encode_
integer - Encode an HPACK integer with N-bit prefix.
- encode_
string_ huffman - Encode a string literal with Huffman coding if beneficial.
- encode_
string_ literal - Encode a string literal without Huffman coding.
- huffman_
decode - Decode Huffman-encoded data (RFC 7541 Appendix B).
- huffman_
encode - Encode data using Huffman coding (RFC 7541 Appendix B).