Trait salvo_core::proto::quic::Connection

source ·
pub trait Connection<B>
where B: Buf,
{ type BidiStream: SendStream<B> + RecvStream; type SendStream: SendStream<B>; type RecvStream: RecvStream; type OpenStreams: OpenStreams<B, SendStream = Self::SendStream, RecvStream = Self::RecvStream, BidiStream = Self::BidiStream>; type Error: Into<Box<dyn Error>>; // Required methods fn poll_accept_recv( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Option<Self::RecvStream>, Self::Error>>; fn poll_accept_bidi( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Option<Self::BidiStream>, Self::Error>>; fn poll_open_bidi( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Self::BidiStream, Self::Error>>; fn poll_open_send( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Self::SendStream, Self::Error>>; fn opener(&self) -> Self::OpenStreams; fn close(&mut self, code: Code, reason: &[u8]); }
Available on crate feature quinn only.
Expand description

Trait representing a QUIC connection.

Required Associated Types§

source

type BidiStream: SendStream<B> + RecvStream

The type produced by poll_accept_bidi()

source

type SendStream: SendStream<B>

The type of the sending part of BidiStream

source

type RecvStream: RecvStream

The type produced by poll_accept_recv()

source

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

A producer of outgoing Unidirectional and Bidirectional streams.

source

type Error: Into<Box<dyn Error>>

Error type yielded by this trait methods

Required Methods§

source

fn poll_accept_recv( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Option<Self::RecvStream>, Self::Error>>

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<Option<Self::BidiStream>, Self::Error>>

Accept an incoming bidirectional stream

Returning None implies the connection is closing or closed.

source

fn poll_open_bidi( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Self::BidiStream, Self::Error>>

Poll the connection to create a new bidirectional stream.

source

fn poll_open_send( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Self::SendStream, Self::Error>>

Poll the connection to create a new unidirectional stream.

source

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

Get an object to open outgoing streams.

source

fn close(&mut self, code: Code, reason: &[u8])

Close the connection immediately

Implementors§