Function accept_and_serve_http

Source
pub async fn accept_and_serve_http<Psk, P, M1, M2, Svc, F, E>(
    listener: TcpListener,
    make_responder: M1,
    make_handle_request: M2,
    timeout: Option<Duration>,
) -> Result<(), Error>
where M1: FnMut(SocketAddr) -> Responder<P, Psk>, P: 'static + Send + FnMut(&[u8]) -> Option<Psk>, Psk: 'static + Send + Sync + AsRef<[u8]>, M2: FnMut(SocketAddr) -> Svc, Svc: 'static + Send + FnMut(&[u8], Request<Body>) -> F, F: 'static + Send + Future<Output = Result<Response<Body>, E>>, E: Into<Box<dyn Error + Send + Sync>>,