pub trait Connection:
Debug
+ Deref<Target = ConnectionOutputs>
+ DerefMut {
// Required methods
fn quic_transport_parameters(&self) -> Option<&[u8]>;
fn zero_rtt_keys(&self) -> Option<DirectionalKeys>;
fn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>;
fn write_hs(&mut self, buf: &mut Vec<u8>) -> Option<KeyChange>;
fn is_handshaking(&self) -> bool;
}Expand description
A QUIC client or server connection.
Required Methods§
Sourcefn quic_transport_parameters(&self) -> Option<&[u8]>
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.
Sourcefn zero_rtt_keys(&self) -> Option<DirectionalKeys>
fn zero_rtt_keys(&self) -> Option<DirectionalKeys>
Compute the keys for encrypting/decrypting 0-RTT packets, if available
Sourcefn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>
fn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>
Consume unencrypted TLS handshake data.
Handshake data obtained from separate encryption levels should be supplied in separate calls.
Sourcefn write_hs(&mut self, buf: &mut Vec<u8>) -> Option<KeyChange>
fn write_hs(&mut self, buf: &mut Vec<u8>) -> Option<KeyChange>
Emit unencrypted TLS handshake data.
When this returns Some(_), the new keys must be used for future handshake data.
Sourcefn is_handshaking(&self) -> bool
fn is_handshaking(&self) -> bool
Returns true if the connection is currently performing the TLS handshake.