Skip to main content

Decoder

Struct Decoder 

Source
pub struct Decoder { /* private fields */ }
Expand description

A QPACK decoder for one HTTP/3 connection.

Implementations§

Source§

impl Decoder

Source

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).

Source

pub fn insert_count(&self) -> u64

Number of entries inserted into the dynamic table so far.

Source

pub fn table_size(&self) -> u64

Current dynamic table size in bytes (entries counted as name + value + 32).

Source

pub fn blocked_streams(&self) -> usize

Number of streams currently blocked.

Source

pub fn decode(&mut self, stream_id: u64, block: &[u8]) -> Result<Decoded, Error>

Decodes a field section received on request stream stream_id.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for Decoder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.