Skip to main content

serve_here

Function serve_here 

Source
pub async fn serve_here<F>(addr: &str, handler: F) -> Result<()>
Expand description

serve for a handler that cannot leave the thread it was made on — one that holds the program’s own bindings, whose collections are not Send. The handler runs on the thread that awaits this future, one request at a time, exactly as serve serializes its calls; the engine runs on a thread and runtime of its own and hands each request across, so the caller’s runtime may be of any flavor. A panic inside a call answers the engines’ shared 500.