Skip to main content

micro_h2/hpack/
mod.rs

1//! HPACK (RFC 7541): header compression for HTTP/2.
2//!
3//! Asymmetric on purpose. Decoding must be complete, because the *server*
4//! decides how to encode and Go's HTTP/2 server uses the dynamic table and
5//! Huffman freely. Encoding can be as simple as we like, because a literal,
6//! unindexed, uncompressed header is always legal — so this crate emits those
7//! and keeps no encoder-side table at all.
8//!
9//! That asymmetry removes the hardest failure mode. An encoder dynamic table has
10//! to stay in step with the peer's decoder copy, and a divergence corrupts every
11//! subsequent header rather than failing outright. Not having one cannot
12//! diverge.
13
14pub mod decode;
15pub mod dynamic;
16pub mod encode;
17pub mod huffman;
18pub mod static_table;
19
20pub use decode::{Decoder, Header};
21pub use dynamic::DynamicTable;
22
23/// The dynamic table size an endpoint assumes before any `SETTINGS` says
24/// otherwise (RFC 7540 section 6.5.2).
25pub const DEFAULT_TABLE_SIZE: usize = 4096;