Skip to main content

serve_with_statics

Function serve_with_statics 

Source
pub async fn serve_with_statics<F>(
    addr: &str,
    handler: F,
    statics: Option<Arc<StaticResponses>>,
) -> Result<()>
where F: Fn(HttpRequest) -> HttpResponse + Send + Sync + 'static,
Expand description

Bind addr and serve forever with a SHARED handler (Fn + Send + Sync — the compiled-handler contract; calls may run concurrently across shards or connection tasks) and an optional pre-serialized StaticResponses table both engines consult before dispatching. Engine selection as in serve.