Skip to main content

HpackBlockEncoder

Struct HpackBlockEncoder 

Source
pub struct HpackBlockEncoder<'table, 'storage, 'entries> { /* private fields */ }
Expand description

An encoder for one HPACK block borrowing connection-owned dynamic-table state.

Implementations§

Source§

impl<'table, 'storage, 'entries> HpackBlockEncoder<'table, 'storage, 'entries>

Source

pub const fn requires_size_update(&self) -> bool

Returns whether a leading dynamic-table size update must precede a field.

Source

pub const fn has_emitted_field(&self) -> bool

Returns whether this block has emitted a header-field representation.

Source

pub fn encode_indexed<'destination>( &mut self, destination: &'destination mut [u8], index: u64, ) -> Result<&'destination [u8], HpackEncodeError>

Encodes one currently resolvable combined static/dynamic table index.

Source

pub fn encode_literal<'destination>( &mut self, destination: &'destination mut [u8], mode: HpackLiteralMode, name: HpackEncodeLiteralName<'_>, value: &[u8], ) -> Result<&'destination [u8], HpackEncodeError>

Encodes one plain literal field and inserts it only for incremental indexing.

Inputs are decoded opaque bytes. This convenience method always emits non-Huffman strings.

Source

pub fn encode_literal_with_huffman<'destination>( &mut self, destination: &'destination mut [u8], mode: HpackLiteralMode, name: HpackEncodeLiteralName<'_>, value: &[u8], strategy: HpackLiteralHuffman, ) -> Result<&'destination [u8], HpackEncodeError>

Encodes one literal field with explicit Huffman choices for emitted strings.

Inputs and any incremental-indexing table entry remain decoded opaque bytes.

Source

pub fn encode_dynamic_table_size_update<'destination>( &mut self, destination: &'destination mut [u8], maximum_size: usize, ) -> Result<&'destination [u8], HpackEncodeError>

Encodes and applies one leading RFC dynamic-table maximum update.

Source

pub fn finish(self) -> Result<(), HpackEncodeError>

Establishes successful semantic completion of this HPACK block.

Auto Trait Implementations§

§

impl<'table, 'storage, 'entries> !UnwindSafe for HpackBlockEncoder<'table, 'storage, 'entries>

§

impl<'table, 'storage, 'entries> Freeze for HpackBlockEncoder<'table, 'storage, 'entries>

§

impl<'table, 'storage, 'entries> RefUnwindSafe for HpackBlockEncoder<'table, 'storage, 'entries>

§

impl<'table, 'storage, 'entries> Send for HpackBlockEncoder<'table, 'storage, 'entries>

§

impl<'table, 'storage, 'entries> Sync for HpackBlockEncoder<'table, 'storage, 'entries>

§

impl<'table, 'storage, 'entries> Unpin for HpackBlockEncoder<'table, 'storage, 'entries>

§

impl<'table, 'storage, 'entries> UnsafeUnpin for HpackBlockEncoder<'table, 'storage, 'entries>

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.