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 and write sides. Normal HTTP/2 operation reads through
ReceivedBody and writes through the driver’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, decided from the stream’s protocol state plus whether a response has been handed off:
- Already removed from the shared map — the driver beat us to cleanup; no-op.
Closed(both halves done on the wire; client-role streams linger in the map for post-EOF trailer/response access) — setSendState::transport_droppedso the driver GCs the lingering entry.- Send half still open + a response was submitted (
submit_resolved) — a bidirectional upgrade tunnel the handler is dropping; enqueueOutboundPart::Closefor a gracefulEND_STREAM. - Anything else (
HalfClosedLocalawaiting the peer, or send-open with no response ever submitted) — abandoning the stream; enqueueRST_STREAM(Cancel).
A server stream dropped while its handler panics, with the response unfinished, is a server
failure rather than a cancellation: it gets a bodyless 500 if no response had been staged,
and otherwise RST_STREAM(INTERNAL_ERROR).
Auto Trait Implementations§
impl !RefUnwindSafe for H2Transport
impl !UnwindSafe for H2Transport
impl Forget for H2Transport
impl Freeze for H2Transport
impl Send for H2Transport
impl Sync for H2Transport
impl Unpin for H2Transport
impl UnsafeUnpin 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