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

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

Return guard that matches if any of supplied guards.

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

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