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>
impl<'sections, 'references> QpackEncoderState<'sections, 'references>
Sourcepub fn new(
sections: &'sections mut [QpackEncoderOutstandingSection],
references: &'references mut [u64],
maximum_blocked_streams: u64,
) -> Self
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.
Sourcepub const fn known_received_count(&self) -> u64
pub const fn known_received_count(&self) -> u64
Returns the number of inserts known to have been received by the peer decoder.
Sourcepub const fn maximum_blocked_streams(&self) -> u64
pub const fn maximum_blocked_streams(&self) -> u64
Returns the peer’s SETTINGS_QPACK_BLOCKED_STREAMS value.
Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Returns the number of outstanding dynamic-reference field sections.
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns whether there are no outstanding dynamic-reference field sections.
Sourcepub const fn reference_len(&self) -> usize
pub const fn reference_len(&self) -> usize
Returns the number of retained dynamic-reference occurrences.
Sourcepub const fn section_storage_capacity(&self) -> usize
pub const fn section_storage_capacity(&self) -> usize
Returns the number of caller-supplied section metadata slots.
Sourcepub const fn reference_storage_capacity(&self) -> usize
pub const fn reference_storage_capacity(&self) -> usize
Returns the number of caller-supplied reference slots.
Sourcepub fn blocked_stream_count(&self) -> usize
pub fn blocked_stream_count(&self) -> usize
Returns the number of distinct streams currently at risk of blocking.
Sourcepub fn register(
&mut self,
stream_id: u64,
required_insert_count: u64,
absolute_references: &[u64],
encoder_insert_count: u64,
) -> Result<(), QpackEncoderStateError>
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.
Sourcepub fn apply(
&mut self,
instruction: QpackDecoderInstruction<'_>,
encoder_insert_count: u64,
) -> Result<(), QpackDecoderInstructionApplyError>
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.
Sourcepub fn apply_sequence(
&mut self,
bytes: &[u8],
encoder_insert_count: u64,
) -> Result<(), QpackDecoderInstructionsApplyError>
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.
Sourcepub fn is_evictable(&self, absolute_index: u64) -> bool
pub fn is_evictable(&self, absolute_index: u64) -> bool
Returns whether an entry may be evicted without invalidating outstanding references.