pub fn fn_guard<F>(f: F) -> impl GuardExpand description
Creates a guard using the given function.
ยงExamples
use actix_web::{guard, web, HttpResponse};
web::route()
    .guard(guard::fn_guard(|ctx| {
        ctx.head().headers().contains_key("content-type")
    }))
    .to(|| HttpResponse::Ok());