pub struct Decoder { /* private fields */ }Expand description
A QPACK decoder for one HTTP/3 connection.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(
max_table_capacity: u64,
max_blocked_streams: u64,
max_field_section_size: u64,
) -> Self
pub fn new( max_table_capacity: u64, max_blocked_streams: u64, max_field_section_size: u64, ) -> Self
max_table_capacity and max_blocked_streams are the values announced in our SETTINGS
(SETTINGS_QPACK_MAX_TABLE_CAPACITY, SETTINGS_QPACK_BLOCKED_STREAMS);
max_field_section_size bounds each decoded section (RFC 9114 4.2.2).
Sourcepub fn insert_count(&self) -> u64
pub fn insert_count(&self) -> u64
Number of entries inserted into the dynamic table so far.
Sourcepub fn table_size(&self) -> u64
pub fn table_size(&self) -> u64
Current dynamic table size in bytes (entries counted as name + value + 32).
Sourcepub fn blocked_streams(&self) -> usize
pub fn blocked_streams(&self) -> usize
Number of streams currently blocked.
Sourcepub fn decode(&mut self, stream_id: u64, block: &[u8]) -> Result<Decoded, Error>
pub fn decode(&mut self, stream_id: u64, block: &[u8]) -> Result<Decoded, Error>
Decodes a field section received on request stream stream_id.
Sourcepub fn on_encoder_stream(
&mut self,
data: &[u8],
) -> Result<Vec<(u64, Result<Vec<Field>, Error>)>, Error>
pub fn on_encoder_stream( &mut self, data: &[u8], ) -> Result<Vec<(u64, Result<Vec<Field>, Error>)>, Error>
Processes bytes from the peer’s encoder stream. Returns the streams that became unblocked, in the order they blocked, with their decode results.
Sourcepub fn cancel_stream(&mut self, stream_id: u64)
pub fn cancel_stream(&mut self, stream_id: u64)
The stream was reset or abandoned before its field sections were fully processed: drops its blocked sections and queues a Stream Cancellation. Call it only for streams whose sections were not all decoded.
Sourcepub fn take_decoder_stream(&mut self, out: &mut Vec<u8>)
pub fn take_decoder_stream(&mut self, out: &mut Vec<u8>)
Appends pending decoder-stream instructions to out: Section Acknowledgments, Stream
Cancellations, then an Insert Count Increment for inserts not yet acknowledged.