Connection

Trait Connection 

Source
pub trait Connection<B: Buf>: OpenStreams<B> {
    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;
}
Expand description

Trait representing a QUIC connection.

Required Associated Types§

Source

type RecvStream: RecvStream

The type produced by poll_accept_recv()

Source

type OpenStreams: OpenStreams<B, SendStream = Self::SendStream, BidiStream = Self::BidiStream>

A producer of outgoing Unidirectional and Bidirectional streams.

Required Methods§

Source

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.

Source

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.

Source

fn opener(&self) -> Self::OpenStreams

Get an object to open outgoing streams.

Implementors§