Skip to main content

Connection

Trait Connection 

Source
pub trait Connection: Debug + Deref<Target = ConnectionOutputs> {
    // Required methods
    fn quic_transport_parameters(&self) -> Option<&[u8]>;
    fn zero_rtt_keys(&self) -> Option<DirectionalKeys>;
    fn read_hs(&mut self, input: &mut dyn TlsInputBuffer) -> Result<(), Error>;
    fn events(&mut self) -> impl Iterator<Item = QuicEvent>;
    fn is_handshaking(&self) -> bool;
}
Expand description

A QUIC client or server connection.

Required Methods§

Source

fn quic_transport_parameters(&self) -> Option<&[u8]>

Return the TLS-encoded transport parameters for the session’s peer.

While the transport parameters are technically available prior to the completion of the handshake, they cannot be fully trusted until the handshake completes, and reliance on them should be minimized. However, any tampering with the parameters will cause the handshake to fail.

Source

fn zero_rtt_keys(&self) -> Option<DirectionalKeys>

Compute the keys for encrypting/decrypting 0-RTT packets, if available

Source

fn read_hs(&mut self, input: &mut dyn TlsInputBuffer) -> Result<(), Error>

Consume unencrypted TLS handshake data.

Handshake data obtained from separate encryption levels should be supplied in separate calls.

How much of the input buffer is consumed is recorded by a call to TlsInputBuffer::discard(). Unconsumed data should be presented again on the next call.

Source

fn events(&mut self) -> impl Iterator<Item = QuicEvent>

Obtain pending events that the caller should process.

All pending events are returned as an iterator.

Source

fn is_handshaking(&self) -> bool

Returns true if the connection is currently performing the TLS handshake.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§