pub struct QuicConn {
inner: Connection,
peer_endpoint: Endpoint,
local_endpoint: Endpoint,
}Expand description
A QUIC connection. Manages streams and datagrams. This is NOT a single read/write channel — it is a stream factory.
Fields§
§inner: Connection§peer_endpoint: Endpoint§local_endpoint: EndpointImplementations§
Source§impl QuicConn
impl QuicConn
Sourcepub async fn open_bi(&self) -> Result<(QuicSendStream, QuicRecvStream)>
pub async fn open_bi(&self) -> Result<(QuicSendStream, QuicRecvStream)>
Open a new bidirectional stream.
Sourcepub async fn open_uni(&self) -> Result<QuicSendStream>
pub async fn open_uni(&self) -> Result<QuicSendStream>
Open a new unidirectional (send-only) stream.
Sourcepub async fn accept_bi(&self) -> Result<(QuicSendStream, QuicRecvStream)>
pub async fn accept_bi(&self) -> Result<(QuicSendStream, QuicRecvStream)>
Accept a bidirectional stream opened by the peer.
Sourcepub async fn accept_uni(&self) -> Result<QuicRecvStream>
pub async fn accept_uni(&self) -> Result<QuicRecvStream>
Accept a unidirectional (receive-only) stream from the peer.
Sourcepub fn send_datagram(&self, data: Bytes) -> Result<()>
pub fn send_datagram(&self, data: Bytes) -> Result<()>
Send an unreliable datagram over the connection. Zero-copy —
ownership of the Bytes allocation is passed to quinn.
Sourcepub async fn recv_datagram(&self) -> Result<Bytes>
pub async fn recv_datagram(&self) -> Result<Bytes>
Receive an unreliable datagram. Zero-copy — wraps the allocation returned by quinn.
Sourcepub fn max_datagram_size(&self) -> Option<usize>
pub fn max_datagram_size(&self) -> Option<usize>
Maximum datagram size the peer supports, or None if unsupported.
Sourcepub fn peer_endpoint(&self) -> Result<Endpoint>
pub fn peer_endpoint(&self) -> Result<Endpoint>
Remote peer’s address.
Sourcepub fn local_endpoint(&self) -> Result<Endpoint>
pub fn local_endpoint(&self) -> Result<Endpoint>
Local address.
Sourcepub async fn closed(&self) -> ConnectionError
pub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed (by us or the peer).
Sourcepub fn peer_certificates(&self) -> Option<Vec<CertificateDer<'static>>>
pub fn peer_certificates(&self) -> Option<Vec<CertificateDer<'static>>>
Peer certificate chain from the QUIC TLS handshake. Quinn returns
a type-erased Box<dyn Any>; for rustls-based QUIC (which is what
karyon uses) it downcasts to Vec<CertificateDer<'static>>.