pub struct QuicTransport {
conn: Connection,
}Expand description
QUIC transport wrapping a quinn::Connection.
Fields§
§conn: ConnectionImplementations§
Source§impl QuicTransport
impl QuicTransport
Sourcepub async fn open_bi(&self) -> Result<(SendStream, RecvStream), TransportError>
pub async fn open_bi(&self) -> Result<(SendStream, RecvStream), TransportError>
Open a bidirectional stream.
Sourcepub async fn accept_bi(
&self,
) -> Result<(SendStream, RecvStream), TransportError>
pub async fn accept_bi( &self, ) -> Result<(SendStream, RecvStream), TransportError>
Accept an incoming bidirectional stream.
Sourcepub async fn open_uni(&self) -> Result<SendStream, TransportError>
pub async fn open_uni(&self) -> Result<SendStream, TransportError>
Open a unidirectional send stream.
Sourcepub async fn accept_uni(&self) -> Result<RecvStream, TransportError>
pub async fn accept_uni(&self) -> Result<RecvStream, TransportError>
Accept an incoming unidirectional stream.
Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), TransportError>
pub fn send_datagram(&self, data: Bytes) -> Result<(), TransportError>
Send a datagram.
Sourcepub async fn recv_datagram(&self) -> Result<Bytes, TransportError>
pub async fn recv_datagram(&self) -> Result<Bytes, TransportError>
Receive a datagram.
Sourcepub fn closed(&self) -> impl Future<Output = TransportError> + Send + 'static
pub fn closed(&self) -> impl Future<Output = TransportError> + Send + 'static
A future resolving when the session ends, carrying the peer’s close.
Borrows nothing and outlives this transport, for the same reason
SendStream::stopped does: the answer arrives after the call that
wanted it has already returned. A peer refusing a handshake commonly
finishes the control stream first and closes the session a round trip
later, so the caller sees an end-of-stream, hands back an error, and
drops the transport before the code it was refused with ever lands.
Taking this handle before the transport is given away is what makes
that code readable at all.
Holding the future keeps the connection alive; dropping it lets quinn close as usual.
Sourcepub fn peer_certificates(&self) -> Vec<Vec<u8>>
pub fn peer_certificates(&self) -> Vec<Vec<u8>>
The certificate chain the peer presented, DER-encoded, leaf first.
Bytes, and no opinion about them: nothing here parses a certificate, checks a date, or decides whether a chain is trustworthy, because the verdict depends on what the caller is measuring. Empty is not an error — a chain is absent for ordinary reasons, including a handshake that has not completed.
A chain that a handshake failed over never reaches here, since there
is no connection left to read it off; that is what
QuicDialOptions::observing is for.