use http::Request;
use hyper::body::Incoming;
use rustls::ServerConnection;
pub trait TlsConnectionMiddleware: Clone + Send + 'static {
type Data: Send;
fn data(&self, connection: &ServerConnection) -> Self::Data;
fn call(&self, req: &mut Request<Incoming>, data: &Self::Data);
}
#[derive(Clone, Copy)]
pub struct NoOpTlsConnectionMiddleware;
impl TlsConnectionMiddleware for NoOpTlsConnectionMiddleware {
type Data = ();
fn data(&self, _connection: &ServerConnection) -> Self::Data {}
fn call(&self, _req: &mut Request<Incoming>, _data: &Self::Data) {}
}