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.