pub struct HpackDecoder { /* private fields */ }Expand description
Stateful HPACK decoder with a per-connection dynamic table.
The same instance is fed all header-block fragments seen on a single h2c connection — both intra-frame (CONTINUATION reassembly) AND inter-stream (different request HEADERS on the same connection share the same dynamic table per RFC 7541 §2.3.1).
Implementations§
Source§impl HpackDecoder
impl HpackDecoder
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset dynamic table to empty (e.g. on connection close — caller dropping the decoder is equivalent).
Sourcepub fn decode_block(
&mut self,
block: &[u8],
) -> Result<Option<DecodedAuthority>, H2ParseError>
pub fn decode_block( &mut self, block: &[u8], ) -> Result<Option<DecodedAuthority>, H2ParseError>
Decode a single header block fragment. Returns the first
:authority value found in the block; Ok(None) if the block
parsed cleanly but contained no :authority (caller emits
l7_h2_authority_missing).
The decoder also returns metadata about how the authority was
extracted so the caller can pick the right reason code:
AuthorityProvenance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HpackDecoder
impl RefUnwindSafe for HpackDecoder
impl Send for HpackDecoder
impl Sync for HpackDecoder
impl Unpin for HpackDecoder
impl UnsafeUnpin for HpackDecoder
impl UnwindSafe for HpackDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more