pub struct FrameReader { /* private fields */ }Expand description
A FrameDecoder wired to a QUIC receive stream.
All of the awaiting happens in one place – [quinn::RecvStream::read_chunk]
– and every byte it produces is accounted for in the decoder before this
returns, which is what makes Self::next cancel-safe. tunnel::udp reads
request streams inside a select! with a timeout, so a dropped read future
must never lose a parsed frame header.
Implementations§
Source§impl FrameReader
impl FrameReader
Sourcepub fn new(recv: RecvStream, budget: Arc<BufferBudget>) -> Self
pub fn new(recv: RecvStream, budget: Arc<BufferBudget>) -> Self
A reader for a stream on which every frame type this server parses may appear.
That is the peer’s control stream: RFC 9114 §6.2.1 makes it the stream
SETTINGS, GOAWAY, CANCEL_PUSH and MAX_PUSH_ID belong on, and which of
them may arrive when is super::connection’s to judge rather than
the framing layer’s. A request stream is read through the crate-internal
on_request_stream instead, where those four – and PUSH_PROMISE – are
refused from the frame header.
It is also what a client wants for a response stream, which is why this
is the constructor that stayed plain: the suite’s client
(tests/common/h3client.rs) is built on this module.
budget is the connection’s, not this stream’s: see BufferBudget.