pub trait ConnectionHandler {
    fn name(&self) -> &str;
    fn handle_connection<'life0, 'async_trait>(
        &'life0 self,
        conn: TcpStream
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn serve<'async_trait, S>(
        self,
        incoming: S
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        S: Stream<Item = Result<TcpStream>> + Unpin + Send,
        Self: Sized + Sync + 'static,
        S: 'async_trait,
        Self: Send + 'async_trait
, { ... } }
Expand description

A connection handler manages an incoming network connection.

Required methods

Returns the name of the connection handler for use in e.g. log messages.

Handles the connection.

Provided methods

Serves incoming TCP traffic from listener.

Implementations on Foreign Types

Implementors