ConnectionHandler

Trait ConnectionHandler 

Source
pub trait ConnectionHandler<T>: Send + Sync {
    type Context: Send;

    // Required methods
    fn verify(
        &self,
        hello: &ClientHello,
    ) -> impl Future<Output = Result<Self::Context, HandshakeError>> + Send;
    fn accept(
        &self,
        output: Self::Context,
        connection: ConnectionHandle<T>,
    ) -> impl Future<Output = ()> + Send;
}

Required Associated Types§

Required Methods§

Source

fn verify( &self, hello: &ClientHello, ) -> impl Future<Output = Result<Self::Context, HandshakeError>> + Send

Source

fn accept( &self, output: Self::Context, connection: ConnectionHandle<T>, ) -> impl Future<Output = ()> + Send

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.

Implementations on Foreign Types§

Source§

impl<T: Send + Sync> ConnectionHandler<T> for Secret

Source§

type Context = ()

Source§

async fn verify(&self, hello: &ClientHello) -> Result<(), HandshakeError>

Source§

async fn accept(&self, _output: Self::Context, _connection: ConnectionHandle<T>)

Implementors§