[][src]Function ntex::web::guard::All

pub fn All<F: Guard + 'static>(guard: F) -> AllGuard

Return guard that matches if all of the supplied guards.

use ntex::web::{self, guard, App, HttpResponse};

fn main() {
    App::new().service(web::resource("/index.html").route(
        web::route()
            .guard(
                guard::All(guard::Get()).and(guard::Header("content-type", "text/plain")))
            .to(|| async { HttpResponse::MethodNotAllowed() }))
    );
}