Skip to main content

Encoder

Struct Encoder 

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

A QPACK encoder for one HTTP/3 connection.

Implementations§

Source§

impl Encoder

Source

pub fn new() -> Self

A static-table-only encoder: it never writes to the encoder stream and every section has a Required Insert Count of 0.

Source

pub fn with_dynamic_table(max_capacity: u64) -> Self

An encoder that uses a dynamic table of up to max_capacity bytes, limited further by the peer’s SETTINGS_QPACK_MAX_TABLE_CAPACITY (see Encoder::set_peer_settings).

Source

pub fn set_peer_settings( &mut self, max_table_capacity: u64, blocked_streams: u64, )

Applies the peer’s SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS. Takes effect only before the first insertion.

Source

pub fn insert_count(&self) -> u64

Number of entries inserted so far.

Source

pub fn known_received_count(&self) -> u64

Number of inserts the decoder has acknowledged.

Source

pub fn encode( &mut self, stream_id: u64, fields: &[(&[u8], &[u8])], out: &mut Vec<u8>, )

Encodes a field section for stream_id into out. Field names must already be lowercase.

Source

pub fn on_decoder_stream(&mut self, data: &[u8]) -> Result<(), Error>

Processes bytes from the peer’s decoder stream (RFC 9204 4.4).

Source

pub fn take_encoder_stream(&mut self, out: &mut Vec<u8>)

Appends pending encoder-stream instructions to out.

Trait Implementations§

Source§

impl Debug for Encoder

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Encoder

Source§

fn default() -> Self

Returns the “default value” for a type. 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.