pub struct Connection { /* private fields */ }Available on crate features
h3-quinn and h3 only.Expand description
A quinn connection adapted to the HTTP/3 transport traits.
Wraps aquinn::Connection; clone the underlying connection and adapt
each side independently as needed.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn new(conn: Connection) -> Self
pub fn new(conn: Connection) -> Self
Adapts an established quinn connection.
The given connection must already have completed its handshake (for
example Connecting::await on the client side, or awaiting an
Incoming on the server side).
Sourcepub fn close_reason(&self) -> Option<ConnectionError>
pub fn close_reason(&self) -> Option<ConnectionError>
The reason the connection was closed, if it has been.
Exposes the raw quinn close reason; the transport traits only report
a closed connection via Accept::poll_accept, so this is used to
observe the application close code directly (diagnostics, tests).
Trait Implementations§
Source§impl Accept for Connection
impl Accept for Connection
Source§fn poll_accept(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Option<Box<dyn BidiStreamTrait>>, TransportError>>
fn poll_accept( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Option<Box<dyn BidiStreamTrait>>, TransportError>>
Polls for the next accepted bidirectional (request) stream. Read more
Source§fn poll_accept_uni(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Option<Box<dyn UniStreamTrait>>, TransportError>>
fn poll_accept_uni( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Option<Box<dyn UniStreamTrait>>, TransportError>>
Polls for the next accepted unidirectional stream (the peer’s
control stream and QPACK streams). Read more
Source§impl Connection for Connection
impl Connection for Connection
Source§fn is_handshake_complete(&self) -> bool
fn is_handshake_complete(&self) -> bool
Whether the handshake has completed. Read more
Source§fn poll_shutdown(
&mut self,
_cx: &mut Context<'_>,
error_code: u64,
) -> Poll<Result<(), TransportError>>
fn poll_shutdown( &mut self, _cx: &mut Context<'_>, error_code: u64, ) -> Poll<Result<(), TransportError>>
Polls to shut down the connection gracefully with an application
error
code, allowing in-flight streams to drain.Source§impl OpenStreams for Connection
impl OpenStreams for Connection
Source§fn poll_open_uni(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Box<dyn UniStreamTrait>, TransportError>>
fn poll_open_uni( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Box<dyn UniStreamTrait>, TransportError>>
Polls the connection to open a new unidirectional stream.
Auto Trait Implementations§
impl !RefUnwindSafe for Connection
impl !Sync for Connection
impl !UnwindSafe for Connection
impl Freeze for Connection
impl Send for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more