logo
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};

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