pub struct H2WritePass { /* private fields */ }Expand description
The let bindings of one write_streams pass, in the order the pre-image
declared them, plus the phase and the three late-initialised values the
inversion has to carry across the poll/handle boundary.
Implementations§
Source§impl H2WritePass
impl H2WritePass
Sourcepub fn new(byte_totals: (usize, usize)) -> Self
pub fn new(byte_totals: (usize, usize)) -> Self
Begin a pass over byte_totals, the connection-wide
(bytes, streams) pair the recycle path distributes overhead against.
Every other field starts empty or zero, exactly as its pre-image let
did. Hoisting those initialisations to pass start is inert: an empty
Vec allocates nothing, and nothing reads any of them before the
statement that used to declare them.
Trait Implementations§
Source§impl Drop for H2WritePass
A tripwire, not the guarantee.
impl Drop for H2WritePass
A tripwire, not the guarantee.
The guarantee that the converter’s three pooled buffers reach
HpackState again is structural: between
Self::adopt_scheduler_pass and the first statement of
H2WritePhase::End, ConnectionH2::poll_write_target has exactly ONE
return — the Transmit yield — and H2Shell::write_streams’ drive
loop answers every Transmit and leaves only on Done or Finalize. So
no pass can end while Self::converter is Some.
This catches the one way that could stop being true: a future caller of the
now-pub poll_write_target that stops driving after a Transmit — a
caller this crate no longer enumerates by reading its own call sites. The
other way — a caller that polls once MORE after the pass answered — is
closed by H2WritePhase::Ended instead, and needs no tripwire because
the converter is already None by then.
Dropping the converter there loses the buffers permanently and silently —
HpackState simply re-grows three Vecs on every pass from then on, with
no error and no metric. debug_assert! puts that in the test suite’s reach
instead; thread::panicking() keeps a real test failure legible rather
than aborting the process on a double panic.