pub trait Connection<B>: OpenStreams<B>where
B: Buf,{
type RecvStream: RecvStream;
type OpenStreams: OpenStreams<B, SendStream = Self::SendStream, BidiStream = Self::BidiStream>;
// Required methods
fn poll_accept_recv(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::RecvStream, ConnectionErrorIncoming>>;
fn poll_accept_bidi(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::BidiStream, ConnectionErrorIncoming>>;
fn opener(&self) -> Self::OpenStreams;
}Available on crate feature
h3 only.Expand description
Trait representing a QUIC connection.
Required Associated Types§
Sourcetype RecvStream: RecvStream
type RecvStream: RecvStream
The type produced by poll_accept_recv()
Sourcetype OpenStreams: OpenStreams<B, SendStream = Self::SendStream, BidiStream = Self::BidiStream>
type OpenStreams: OpenStreams<B, SendStream = Self::SendStream, BidiStream = Self::BidiStream>
A producer of outgoing Unidirectional and Bidirectional streams.
Required Methods§
Sourcefn poll_accept_recv(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::RecvStream, ConnectionErrorIncoming>>
fn poll_accept_recv( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::RecvStream, ConnectionErrorIncoming>>
Accept an incoming unidirectional stream
Returning None implies the connection is closing or closed.
Sourcefn poll_accept_bidi(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::BidiStream, ConnectionErrorIncoming>>
fn poll_accept_bidi( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::BidiStream, ConnectionErrorIncoming>>
Accept an incoming bidirectional stream
Returning None implies the connection is closing or closed.
Sourcefn opener(&self) -> Self::OpenStreams
fn opener(&self) -> Self::OpenStreams
Get an object to open outgoing streams.