pub struct HpackDecoder { /* private fields */ }Expand description
A connection-direction HPACK decoder with bounded table and header-list sizes.
Implementations§
Source§impl HpackDecoder
impl HpackDecoder
Sourcepub fn new(max_table_size: usize, max_header_list_size: usize) -> HpackDecoder
pub fn new(max_table_size: usize, max_header_list_size: usize) -> HpackDecoder
Sourcepub fn set_max_table_size(&mut self, size: usize)
pub fn set_max_table_size(&mut self, size: usize)
Sourcepub fn decode(
&mut self,
block: &[u8],
) -> Result<Vec<(String, String)>, ProtoError>
pub fn decode( &mut self, block: &[u8], ) -> Result<Vec<(String, String)>, ProtoError>
Decodes one complete header block, preserving order and duplicate fields. A list-size rejection still processes valid table changes through the end of the block, allowing later streams to reuse the compression context. Names and values must be UTF-8 because this API exposes Rust strings. A compression error permanently rejects later blocks because the peer’s table state can no longer be recovered from the malformed block.
§Errors
Returns ProtoError::Hpack for malformed representations, invalid table
references, integer overflow, invalid UTF-8, missing required updates,
or a compression context that previously failed.
Returns ProtoError::HeaderListTooLarge if the decoded list exceeds its limit.
§Panics
This function does not panic.