pub fn All<F: Guard + 'static>(guard: F) -> AllGuardExpand description
Return guard that matches if all of the supplied guards.
use ntex::web::{self, guard, App, HttpResponse};
fn main() {
App::default().service(web::resource("/index.html").route(
web::route()
.guard(
guard::All(guard::Get()).and(guard::Header("content-type", "text/plain")))
.to(async || { HttpResponse::MethodNotAllowed() }))
);
}