matches_pattern_with_method

Function matches_pattern_with_method 

Source
pub fn matches_pattern_with_method(
    method: Option<&str>,
    path: &str,
    pattern: &str,
) -> bool
Expand description

Check if a request (method + path) matches a pattern Pattern can be just a path or “METHOD /path” Examples: matches_pattern_with_method(Some(“POST”), “/api/users”, “POST /api/”) -> true matches_pattern_with_method(Some(“GET”), “/api/users”, “POST /api/”) -> false matches_pattern_with_method(Some(“GET”), “/api/users”, “/api/*”) -> true (no method constraint)