Skip to main content

serve

Function serve 

Source
pub fn serve<H>(
    addr: &str,
    workers: usize,
    limits: Limits,
    handler: H,
) -> Result<()>
where H: Fn(Request) -> Response + Send + Sync + 'static,
Expand description

Bind to addr and serve requests with handler until the process exits. handler is shared across worker threads, so it must be Send + Sync.