pub struct FrameDecoder { /* private fields */ }h3 only.Expand description
Incremental HTTP/3 frame decoder.
The decoder owns its buffer: the driver calls FrameDecoder::extend
with every received chunk and FrameDecoder::next_frame once per
event-loop turn, draining as many complete frames as are buffered.
Implementations§
Source§impl FrameDecoder
impl FrameDecoder
Sourcepub fn next_frame(&mut self) -> Result<Option<Frame>, FrameError>
pub fn next_frame(&mut self) -> Result<Option<Frame>, FrameError>
Pops the next complete frame, if any.
Returns Ok(None) when the buffer does not yet hold a complete
frame; callers must extend the buffer and poll again. Unknown and
reserved frame types are consumed and skipped (RFC 9114 Section
7.2.8) — a known frame behind them is still returned.
Source§impl FrameDecoder
impl FrameDecoder
Sourcepub fn peek_frame_type(&self) -> Option<u64>
pub fn peek_frame_type(&self) -> Option<u64>
Returns the type of the next frame without consuming it, or None
when the type varint is incomplete. Used to pre-reject control-plane
frames on request streams (RFC 9114 Sections 7.2.3-7.2.7) before the
decoder parses (and would otherwise accept or mismatch) them.