Skip to main content

QpackEncoderState

Struct QpackEncoderState 

Source
pub struct QpackEncoderState<'sections, 'references> { /* private fields */ }
Expand description

Caller-owned encoder accounting for outstanding field sections with dynamic references.

maximum_blocked_streams is the peer’s SETTINGS_QPACK_BLOCKED_STREAMS value. Field-section encoding reserves this state before writing output and commits the reservation only after emission succeeds, keeping output and accounting atomic. Packed sections and reference occurrences are retained in registration order for later decoder-instruction application.

Implementations§

Source§

impl<'sections, 'references> QpackEncoderState<'sections, 'references>

Source

pub fn new( sections: &'sections mut [QpackEncoderOutstandingSection], references: &'references mut [u64], maximum_blocked_streams: u64, ) -> Self

Creates empty accounting backed by caller-owned section and reference storage.

Source

pub const fn known_received_count(&self) -> u64

Returns the number of inserts known to have been received by the peer decoder.

Source

pub const fn maximum_blocked_streams(&self) -> u64

Returns the peer’s SETTINGS_QPACK_BLOCKED_STREAMS value.

Source

pub const fn len(&self) -> usize

Returns the number of outstanding dynamic-reference field sections.

Source

pub const fn is_empty(&self) -> bool

Returns whether there are no outstanding dynamic-reference field sections.

Source

pub const fn reference_len(&self) -> usize

Returns the number of retained dynamic-reference occurrences.

Source

pub const fn section_storage_capacity(&self) -> usize

Returns the number of caller-supplied section metadata slots.

Source

pub const fn reference_storage_capacity(&self) -> usize

Returns the number of caller-supplied reference slots.

Source

pub fn blocked_stream_count(&self) -> usize

Returns the number of distinct streams currently at risk of blocking.

Source

pub fn register( &mut self, stream_id: u64, required_insert_count: u64, absolute_references: &[u64], encoder_insert_count: u64, ) -> Result<(), QpackEncoderStateError>

Registers an outstanding field section containing dynamic-reference occurrences.

References are copied unchanged and may contain duplicates. This method validates every condition before mutating state. It does not check whether referenced entries are active; that is the future field-section encoder’s responsibility.

Source

pub fn apply( &mut self, instruction: QpackDecoderInstruction<'_>, encoder_insert_count: u64, ) -> Result<(), QpackDecoderInstructionApplyError>

Applies one parsed decoder-stream instruction to outstanding-reference accounting.

A Stream Cancellation removes all matching sections but does not advance the Known Received Count.

Source

pub fn apply_sequence( &mut self, bytes: &[u8], encoder_insert_count: u64, ) -> Result<(), QpackDecoderInstructionsApplyError>

Validates and applies a complete unframed decoder-stream instruction sequence.

The complete sequence is validated before any accounting state or caller-owned backing storage is changed. On an application failure, earlier successful instructions remain committed, the failing instruction remains atomic under Self::apply, and later instructions are not attempted.

Source

pub fn is_evictable(&self, absolute_index: u64) -> bool

Returns whether an entry may be evicted without invalidating outstanding references.

Auto Trait Implementations§

§

impl<'sections, 'references> !UnwindSafe for QpackEncoderState<'sections, 'references>

§

impl<'sections, 'references> Freeze for QpackEncoderState<'sections, 'references>

§

impl<'sections, 'references> RefUnwindSafe for QpackEncoderState<'sections, 'references>

§

impl<'sections, 'references> Send for QpackEncoderState<'sections, 'references>

§

impl<'sections, 'references> Sync for QpackEncoderState<'sections, 'references>

§

impl<'sections, 'references> Unpin for QpackEncoderState<'sections, 'references>

§

impl<'sections, 'references> UnsafeUnpin for QpackEncoderState<'sections, 'references>

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.