Skip to main content

H2WriteTarget

Enum H2WriteTarget 

Source
pub enum H2WriteTarget {
    Done(MuxResult),
    Transmit {
        stream_id: H2StreamId,
    },
    Finalize {
        socket_write: bool,
        bytes_written: usize,
    },
}
Expand description

What ConnectionH2::poll_write_target wants its caller to do before it may call ConnectionH2::handle_write.

The write half of H2ReadTarget’s protocol, with ONE forced divergence: a readable() pass performs exactly one socket_read, so the read side is a two-call protocol that ENDS with handle_read. A write pass performs an unbounded number of socket_write_vectored calls — the pre-image’s while !kawa.out.is_empty() inside a loop over the scheduler’s order — so the write side is a DRIVE LOOP. ConnectionH2::handle_write settles one transmit and answers nothing; the pass’s result comes from Self::Done or from the ConnectionH2::finalize_write the caller runs for Self::Finalize.

Variants§

§

Done(MuxResult)

The core ended the pass by itself. No write, no ConnectionH2::handle_write, and no finalize — this is the pass’s result.

Two sites, and neither may become a Self::Finalize: the resume path’s stall and the MadeYouReset emitted-RST cap trip. Folding either into Finalize would run LIFECYCLE §9 invariant 16’s readiness policy over a pass that must not reach it.

§

Transmit

Gather stream_id’s queued blocks with h2_transmit::gather, hand the descriptors to socket_write_vectored, discharge them with h2_transmit::confirm, then answer with ConnectionH2::handle_write.

stream_id is never H2StreamId::Zero: self.zero is input only, the resume phase parks and matches H2StreamId::Other only, and the scheduler loop walks real stream ids. The transmit sends the ordered output queue first (ConnectionH2::gather_transmit), so the rest of a frame an earlier write cut always leaves ahead of the next frame.

Fields

§stream_id: H2StreamId
§

Finalize

The pass is over and owes the readiness decision of LIFECYCLE §9 invariant 16. Read H2Shell::tls_wants_write, hand it to ConnectionH2::finalize_write alongside socket_write and bytes_written, and drive the H2FinalizeTarget that answers; the end of that protocol is the pass’s result.

bytes_written rides along with socket_write because finalize_write reads it as made_progress, and that is what selects FinalizeAction::RetainPendingBack over Quiesce. It is accumulated stream by stream inside the loop, so only the pass knows it.

Fields

§socket_write: bool
§bytes_written: usize

Trait Implementations§

Source§

impl Clone for H2WriteTarget

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for H2WriteTarget

Source§

impl Debug for H2WriteTarget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.