pub struct QuicConnection { /* private fields */ }Expand description
A materialized QUIC connection.
Implementations§
Source§impl QuicConnection
impl QuicConnection
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Returns the local UDP endpoint address for this connection.
Sourcepub fn remote_addr(&self) -> SocketAddr
pub fn remote_addr(&self) -> SocketAddr
Returns the peer UDP endpoint address for this connection.
Sourcepub fn chunk_size(&self) -> usize
pub fn chunk_size(&self) -> usize
Returns the default chunk size used by stream helpers on this connection.
Sourcepub fn quinn_connection(&self) -> &Connection
pub fn quinn_connection(&self) -> &Connection
Returns the underlying Quinn connection handle.
Sourcepub fn quinn_endpoint(&self) -> &Endpoint
pub fn quinn_endpoint(&self) -> &Endpoint
Returns the underlying Quinn endpoint handle that owns the UDP socket.
Sourcepub fn open_bi(
&self,
chunk_size: usize,
) -> Flow<Vec<u8>, Vec<u8>, StreamCompletion<QuicStream>>
pub fn open_bi( &self, chunk_size: usize, ) -> Flow<Vec<u8>, Vec<u8>, StreamCompletion<QuicStream>>
Opens a bidirectional QUIC stream as a Datum byte flow.
Opening and the stream-id allocation happen when this flow is
materialized. Quinn only exposes the stream to the peer after the
initiating side writes data, so a peer-side accept_bi will not complete
until the first write or FIN is sent.
Sourcepub fn open_bi_default(
&self,
) -> Flow<Vec<u8>, Vec<u8>, StreamCompletion<QuicStream>>
pub fn open_bi_default( &self, ) -> Flow<Vec<u8>, Vec<u8>, StreamCompletion<QuicStream>>
Opens a bidirectional stream using the connection’s default chunk size.
Sourcepub fn open_bi_stream(
&self,
chunk_size: usize,
) -> Source<QuicBidirectionalStream, StreamCompletion<QuicStream>>
pub fn open_bi_stream( &self, chunk_size: usize, ) -> Source<QuicBidirectionalStream, StreamCompletion<QuicStream>>
Opens a bidirectional QUIC stream and emits the split stream object.
This is the object-shaped counterpart to QuicConnection::open_bi,
used by protocol carriers that need to drive the byte source and sink
independently.
Sourcepub fn open_bi_stream_default(
&self,
) -> Source<QuicBidirectionalStream, StreamCompletion<QuicStream>>
pub fn open_bi_stream_default( &self, ) -> Source<QuicBidirectionalStream, StreamCompletion<QuicStream>>
Opens a split bidirectional stream using the connection’s default chunk size.
Sourcepub fn open_bi_stream_available(
&self,
chunk_size: usize,
) -> Source<QuicBidirectionalStream, StreamCompletion<QuicStream>>
pub fn open_bi_stream_available( &self, chunk_size: usize, ) -> Source<QuicBidirectionalStream, StreamCompletion<QuicStream>>
Opens a split bidirectional stream with emit-available read mode.
Like open_bi_stream but the byte source emits chunks as soon as
any bytes arrive rather than waiting to fill chunk_size. Use for
interactive protocols (e.g. StreamRefs) where small frames must flow
without accumulating in the read buffer.
Sourcepub fn accept_bi(
&self,
chunk_size: usize,
) -> Source<QuicBidirectionalStream, QuicConnection>
pub fn accept_bi( &self, chunk_size: usize, ) -> Source<QuicBidirectionalStream, QuicConnection>
Accepts incoming bidirectional QUIC streams.
Each downstream pull accepts one stream. Accepted streams are emitted as
QuicBidirectionalStream values that can be split or converted into a
Datum byte flow.
Sourcepub fn accept_bi_default(
&self,
) -> Source<QuicBidirectionalStream, QuicConnection>
pub fn accept_bi_default( &self, ) -> Source<QuicBidirectionalStream, QuicConnection>
Accepts incoming bidirectional streams using the connection’s default chunk size.
Sourcepub fn accept_bi_available(
&self,
chunk_size: usize,
) -> Source<QuicBidirectionalStream, QuicConnection>
pub fn accept_bi_available( &self, chunk_size: usize, ) -> Source<QuicBidirectionalStream, QuicConnection>
Accepts incoming bidirectional streams with emit-available read mode.
Like accept_bi but the byte source emits chunks as soon as any
bytes arrive rather than waiting to fill chunk_size.
Trait Implementations§
Source§impl Clone for QuicConnection
impl Clone for QuicConnection
Source§fn clone(&self) -> QuicConnection
fn clone(&self) -> QuicConnection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more