[][src]Function actix_web::pred::Any

pub fn Any<S: 'static, P: Predicate<S> + 'static>(pred: P) -> AnyPredicate<S>

Return predicate that matches if any of supplied predicate matches.

use actix_web::{pred, App, HttpResponse};

fn main() {
    App::new().resource("/index.html", |r| {
        r.route()
            .filter(pred::Any(pred::Get()).or(pred::Post()))
            .f(|r| HttpResponse::MethodNotAllowed())
    });
}