Skip to main content

serve_with

Function serve_with 

pub async fn serve_with<F, Fut>(
    listener: TcpListener,
    tls: Option<Tls>,
    answer: F,
) -> Result<()>
where F: Fn(Option<String>, Vec<u8>) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Reply> + Send + 'static,
Expand description

Like serve, answering each POST with answer(signature header, body): for a process that hands invocations on (to a child process, a queue) instead of running them itself.