pub trait Context<Crypto: CryptoSuite> {
Show 21 methods
// Required methods
fn on_client_application_params(
&mut self,
client_params: ApplicationParameters<'_>,
server_params: &mut Vec<u8>,
) -> Result<(), Error>;
fn on_handshake_keys(
&mut self,
key: Crypto::HandshakeKey,
header_key: Crypto::HandshakeHeaderKey,
) -> Result<(), Error>;
fn on_zero_rtt_keys(
&mut self,
key: Crypto::ZeroRttKey,
header_key: Crypto::ZeroRttHeaderKey,
application_parameters: ApplicationParameters<'_>,
) -> Result<(), Error>;
fn on_one_rtt_keys(
&mut self,
key: Crypto::OneRttKey,
header_key: Crypto::OneRttHeaderKey,
application_parameters: ApplicationParameters<'_>,
) -> Result<(), Error>;
fn on_server_name(&mut self, server_name: ServerName) -> Result<(), Error>;
fn on_application_protocol(
&mut self,
application_protocol: Bytes,
) -> Result<(), Error>;
fn on_key_exchange_group(
&mut self,
named_group: NamedGroup,
) -> Result<(), Error>;
fn on_handshake_complete(&mut self) -> Result<(), Error>;
fn on_tls_context(&mut self, _context: Box<dyn Any + Send>);
fn on_tls_exporter_ready(
&mut self,
session: &impl TlsSession,
) -> Result<(), Error>;
fn on_tls_handshake_failed(
&mut self,
session: &impl TlsSession,
) -> Result<(), Error>;
fn receive_initial(&mut self, max_len: Option<usize>) -> Option<Bytes>;
fn receive_handshake(&mut self, max_len: Option<usize>) -> Option<Bytes>;
fn receive_application(&mut self, max_len: Option<usize>) -> Option<Bytes>;
fn can_send_initial(&self) -> bool;
fn send_initial(&mut self, transmission: Bytes);
fn can_send_handshake(&self) -> bool;
fn send_handshake(&mut self, transmission: Bytes);
fn can_send_application(&self) -> bool;
fn send_application(&mut self, transmission: Bytes);
fn waker(&self) -> &Waker;
}Required Methods§
Sourcefn on_client_application_params(
&mut self,
client_params: ApplicationParameters<'_>,
server_params: &mut Vec<u8>,
) -> Result<(), Error>
fn on_client_application_params( &mut self, client_params: ApplicationParameters<'_>, server_params: &mut Vec<u8>, ) -> Result<(), Error>
Called when the client’s application parameters are available, prior to completion of the handshake.
The server_params is provided as a mutable Vec<u8> of encoded
server transport parameters to allow for additional parameters
dependent on the client_params to be appended before transmitting
them to the client.
The value of transport parameters is not authenticated until the handshake completes, so any use of these parameters cannot depend on their authenticity.
NOTE: This function is not currently supported
for the s2n-quic-rustls provider
fn on_handshake_keys( &mut self, key: Crypto::HandshakeKey, header_key: Crypto::HandshakeHeaderKey, ) -> Result<(), Error>
fn on_zero_rtt_keys( &mut self, key: Crypto::ZeroRttKey, header_key: Crypto::ZeroRttHeaderKey, application_parameters: ApplicationParameters<'_>, ) -> Result<(), Error>
fn on_one_rtt_keys( &mut self, key: Crypto::OneRttKey, header_key: Crypto::OneRttHeaderKey, application_parameters: ApplicationParameters<'_>, ) -> Result<(), Error>
fn on_server_name(&mut self, server_name: ServerName) -> Result<(), Error>
fn on_application_protocol( &mut self, application_protocol: Bytes, ) -> Result<(), Error>
fn on_key_exchange_group( &mut self, named_group: NamedGroup, ) -> Result<(), Error>
fn on_handshake_complete(&mut self) -> Result<(), Error>
Sourcefn on_tls_context(&mut self, _context: Box<dyn Any + Send>)
fn on_tls_context(&mut self, _context: Box<dyn Any + Send>)
Set TLS context and transfer from TLS provider to application layer.
fn on_tls_exporter_ready( &mut self, session: &impl TlsSession, ) -> Result<(), Error>
fn on_tls_handshake_failed( &mut self, session: &impl TlsSession, ) -> Result<(), Error>
Sourcefn receive_initial(&mut self, max_len: Option<usize>) -> Option<Bytes>
fn receive_initial(&mut self, max_len: Option<usize>) -> Option<Bytes>
Receives data from the initial packet space
A max_len may be provided to indicate how many bytes the TLS implementation
is willing to buffer.
Sourcefn receive_handshake(&mut self, max_len: Option<usize>) -> Option<Bytes>
fn receive_handshake(&mut self, max_len: Option<usize>) -> Option<Bytes>
Receives data from the handshake packet space
A max_len may be provided to indicate how many bytes the TLS implementation
is willing to buffer.
Sourcefn receive_application(&mut self, max_len: Option<usize>) -> Option<Bytes>
fn receive_application(&mut self, max_len: Option<usize>) -> Option<Bytes>
Receives data from the application packet space
A max_len may be provided to indicate how many bytes the TLS implementation
is willing to buffer.
fn can_send_initial(&self) -> bool
fn send_initial(&mut self, transmission: Bytes)
fn can_send_handshake(&self) -> bool
fn send_handshake(&mut self, transmission: Bytes)
fn can_send_application(&self) -> bool
fn send_application(&mut self, transmission: Bytes)
fn waker(&self) -> &Waker
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.