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§
sourcetype BidiStream: SendStream<B> + RecvStream
type BidiStream: SendStream<B> + RecvStream
The type produced by poll_accept_bidi()
sourcetype SendStream: SendStream<B>
type SendStream: SendStream<B>
The type of the sending part of BidiStream
sourcetype RecvStream: RecvStream
type RecvStream: RecvStream
The type produced by poll_accept_recv()
sourcetype OpenStreams: OpenStreams<B, SendStream = Self::SendStream, RecvStream = Self::RecvStream, BidiStream = Self::BidiStream>
type OpenStreams: OpenStreams<B, SendStream = Self::SendStream, RecvStream = Self::RecvStream, BidiStream = Self::BidiStream>
A producer of outgoing Unidirectional and Bidirectional streams.
Required Methods§
sourcefn poll_accept_recv(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<Option<Self::RecvStream>, Self::Error>>
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.
sourcefn poll_accept_bidi(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<Option<Self::BidiStream>, Self::Error>>
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.
sourcefn poll_open_bidi(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<Self::BidiStream, Self::Error>>
fn poll_open_bidi( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Self::BidiStream, Self::Error>>
Poll the connection to create a new bidirectional stream.
sourcefn poll_open_send(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<Self::SendStream, Self::Error>>
fn poll_open_send( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Self::SendStream, Self::Error>>
Poll the connection to create a new unidirectional stream.
sourcefn opener(&self) -> Self::OpenStreams
fn opener(&self) -> Self::OpenStreams
Get an object to open outgoing streams.