Trait materialized::mux::ConnectionHandler
source · [−]pub trait ConnectionHandler {
fn name(&self) -> &str;
fn match_handshake(&self, buf: &[u8]) -> bool;
fn handle_connection<'life0, 'async_trait>(
&'life0 self,
conn: SniffedStream<TcpStream>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: '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.
Determines whether this handler can accept the connection based on the first several bytes in the stream.