pub struct H2Transport { /* private fields */ }Expand description
A single HTTP/2 stream’s transport handle.
Carries a backref to the shared H2Connection, the stream id, and the per-stream
Arc<StreamState> used by the read side. Normal HTTP/2 operation reads through
ReceivedBody and writes through the connection’s send queue;
the AsyncRead / AsyncWrite impls here are only reached by code that borrows the
transport directly (typically an upgrade handler after extended CONNECT).
Implementations§
Source§impl H2Transport
impl H2Transport
Sourcepub fn connection(&self) -> &Arc<H2Connection>
pub fn connection(&self) -> &Arc<H2Connection>
The shared H2Connection backing this stream.
Trait Implementations§
Source§impl AsyncRead for H2Transport
impl AsyncRead for H2Transport
Source§impl AsyncWrite for H2Transport
impl AsyncWrite for H2Transport
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
buf into the object. Read moreSource§fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
Source§impl Debug for H2Transport
impl Debug for H2Transport
Source§impl Drop for H2Transport
impl Drop for H2Transport
Source§fn drop(&mut self)
fn drop(&mut self)
Application-side release / cancel signal, depending on stream state:
-
Wire-closed cleanly (
send.completed && recv.eof): the application is done with a stream that already finished on the wire. The client-role lifecycle keeps such streams in the map after wire-close (seeH2Driver::try_close_if_both_done) so the application’s transport handle remains valid for trailer / late-read access. Dropping the transport is the signal that the application is done, and we forward it to the connection so the driver removes the entry from both maps. -
Wire-incomplete (handler panic, conn task abandoned, client awaiting a response that never came): emit
RST_STREAM(Cancel)so the peer learns we’re abandoning the stream. Without this the leak persists until the entire connection tears down. Symmetric for both roles. -
Already gone from the shared map: driver beat us to cleanup; no-op.
-
Upgrade path graceful close in flight (
outbound_close_requested): user has already asked for graceful close viaSelf::poll_close; the driver is draining the outbound queue + emittingDATA(END_STREAM). Don’t RST in that window.
Auto Trait Implementations§
impl Freeze for H2Transport
impl !RefUnwindSafe for H2Transport
impl Send for H2Transport
impl Sync for H2Transport
impl Unpin for H2Transport
impl UnsafeUnpin for H2Transport
impl !UnwindSafe for H2Transport
Blanket Implementations§
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
buf. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit bytes from it. Read moreSource§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
Source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
Source§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
Source§fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
Source§fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a>>
fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a>>
dyn AsyncWrite + Send + 'a. Read more