pub struct Decoder { /* private fields */ }Expand description
An HPACK decoder: one per connection direction.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(max_table_size: u32) -> Self
pub fn new(max_table_size: u32) -> Self
A decoder whose table is bounded by max_table_size, the
SETTINGS_HEADER_TABLE_SIZE this side advertised.
Sourcepub fn set_max_table_size(&mut self, max: u32)
pub fn set_max_table_size(&mut self, max: u32)
Follows a change of our SETTINGS_HEADER_TABLE_SIZE: later updates
are bounded by it, and the table shrinks to it at once.
Sourcepub fn decode(
&mut self,
block: &[u8],
limits: Limits,
out: &mut Vec<(Vec<u8>, Vec<u8>)>,
) -> Result<(), DecodeError>
pub fn decode( &mut self, block: &[u8], limits: Limits, out: &mut Vec<(Vec<u8>, Vec<u8>)>, ) -> Result<(), DecodeError>
Decodes one complete field block, appending (name, value) pairs to
out in order.
§Errors
TooLarge "field section" when the fields, counted as name plus
value plus 32 each (RFC 9113 §6.5.2), exceed
Limits::max_head_bytes, "field count" past
Limits::max_fields, "string" for one string longer than
max_head_bytes; Malformed naming the rule: "index", a table
size update that is "not at the start of a block" or
"above the advertised table size", "truncated field block",
"integer", the Huffman refusals. After any of these the decoder must
not be used again: the dynamic table may hold half a block (RFC 7541
§2.3.3 makes this a connection error).
Malformed "uppercase field name" is the exception: the block is
decoded to its end first, so the dynamic table stays in step with the
peer’s encoder and the connection can refuse only that stream
(RFC 9113 §8.2.1). out then holds the block’s fields.