Skip to main content

Module hpack

Module hpack 

Source
Expand description

HPACK (RFC 7541): header compression for HTTP/2.

Asymmetric on purpose. Decoding must be complete, because the server decides how to encode and Go’s HTTP/2 server uses the dynamic table and Huffman freely. Encoding can be as simple as we like, because a literal, unindexed, uncompressed header is always legal — so this crate emits those and keeps no encoder-side table at all.

That asymmetry removes the hardest failure mode. An encoder dynamic table has to stay in step with the peer’s decoder copy, and a divergence corrupts every subsequent header rather than failing outright. Not having one cannot diverge.

Re-exports§

pub use decode::Decoder;
pub use decode::Header;
pub use dynamic::DynamicTable;

Modules§

decode
Decoding a header block.
dynamic
The HPACK dynamic table.
encode
Encoding a header block.
huffman
HPACK’s Huffman code (RFC 7541 Appendix B).
static_table
HPACK’s static table (RFC 7541 Appendix A).

Constants§

DEFAULT_TABLE_SIZE
The dynamic table size an endpoint assumes before any SETTINGS says otherwise (RFC 7540 section 6.5.2).