pub struct H2StreamReassembler { /* private fields */ }Expand description
Per-stream HEADERS+CONTINUATION accumulator (Phase 3g.1).
One instance per h2 connection, fed every HEADERS / CONTINUATION frame the proxy parses. Returns the completed (stream-id, block) pair when END_HEADERS is observed; otherwise tracks the pending reassembly internally.
Non-HEADERS / non-CONTINUATION frames pass through with Ok(None).
A non-CONTINUATION frame from any stream while a reassembly is open
on another stream is rejected as
H2ParseError::InterleavedFrame (RFC 7540 §6.10).
Implementations§
Source§impl H2StreamReassembler
impl H2StreamReassembler
Sourcepub fn ingest(
&mut self,
frame: &FrameHeader,
payload: &[u8],
) -> Result<Option<(u32, Vec<u8>)>, H2ParseError>
pub fn ingest( &mut self, frame: &FrameHeader, payload: &[u8], ) -> Result<Option<(u32, Vec<u8>)>, H2ParseError>
Feed a single frame’s (header, payload) pair.
Returns:
Ok(Some((stream_id, block)))— the frame completed a HEADERS+CONTINUATION block. The block has had padding + priority stripped (frame layer) and is the concatenated header block fragment ready forHpackDecoder::decode_block.Ok(None)— the frame either was not HEADERS/CONTINUATION (passed through; pure flow-control or DATA), or was HEADERS without END_HEADERS (more bytes needed), or was a CONTINUATION without END_HEADERS (more bytes needed).Err(InterleavedFrame)— RFC 7540 §6.10 violation: a frame appeared between HEADERS and the END_HEADERS-bearing CONTINUATION on the same stream; or a CONTINUATION arrived for a stream that does NOT have an open reassembly.Err(ReassemblerOverflow)— one of the defensive bounds tripped; caller RST_STREAMs the offending stream id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for H2StreamReassembler
impl RefUnwindSafe for H2StreamReassembler
impl Send for H2StreamReassembler
impl Sync for H2StreamReassembler
impl Unpin for H2StreamReassembler
impl UnsafeUnpin for H2StreamReassembler
impl UnwindSafe for H2StreamReassembler
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