logo

Function actix_web::guard::Any[][src]

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

Return guard that matches if any of supplied guards.

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

App::new().service(web::resource("/index.html").route(
    web::route()
         .guard(guard::Any(guard::Get()).or(guard::Post()))
         .to(|| HttpResponse::MethodNotAllowed()))
);