Skip to main content

H2WritePass

Struct H2WritePass 

Source
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

Source

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.

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.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.