pub trait ConnectionInitializer: 'static + Send + Sync {
    // Required method
    fn initialize_connection(
        &self,
        connection: &mut Connection
    ) -> Result<Option<Pin<Box<dyn ConnectionFuture>>>, Error>;
}
Expand description

A trait executed asynchronously before a new connection negotiates TLS.

Used for dynamic configuration of a specific connection.

§Safety: This trait is polled to completion at the beginning of the

connection::poll_negotiate function. Therefore, negotiation of the TLS connection will not begin until the Future has completed.

Required Methods§

source

fn initialize_connection( &self, connection: &mut Connection ) -> Result<Option<Pin<Box<dyn ConnectionFuture>>>, Error>

The application can return an Ok(None) to resolve the callback synchronously or return an Ok(Some(ConnectionFuture)) if it wants to run some asynchronous task before resolving the callback.

Implementations on Foreign Types§

source§

impl<A, B> ConnectionInitializer for (A, B)

Implementors§