logo

Function actix_web::guard::All[][src]

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

Return guard that matches if all of the supplied guards.

use actix_web::{guard, web, App, HttpResponse};

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