pub enum H2ReadTarget {
Done(MuxResult),
Skip(H2StreamId),
Fill {
stream_id: H2StreamId,
amount: usize,
},
}Expand description
What ConnectionH2::poll_read_target wants its caller to do before it
may call ConnectionH2::handle_read.
The three variants are the three shapes one frontend read pass takes, and
Self::Skip is deliberately not folded into a Fill { amount: 0 }: that
would have the caller issue a zero-length read, and
update_readiness_after_read reads its (0, SocketResult::Continue)
answer as “nothing arrived, stop” — so every frame carrying no payload (an
empty SETTINGS, an empty DATA, a SETTINGS ACK) would stop being parsed at
all. The variant is what stops a caller from having to know that.
Variants§
Done(MuxResult)
The core ended the pass by itself: a SETTINGS-ACK timeout, nothing owed
by the peer, or no room left for what is owed. No read, and no
ConnectionH2::handle_read — this is the pass’s result.
Skip(H2StreamId)
Every byte the core is waiting for already sits in stream_id’s
buffer, because the frame in flight carries a zero-length payload.
Perform no read and answer with H2ReadOutcome::Skipped.
Fill
Read into the space read_space returns for stream_id, which is
exactly amount bytes and never less than one, then answer with
H2ReadOutcome::Filled.