pub fn match_path(pattern: &str, pathname: &str) -> Option<PathParams>Expand description
Match a concrete path against a pattern, capturing its path parameters.
A :name segment captures one non-empty segment, and a * segment captures
everything left, including slashes.
ยงExamples
use lino_rest_api::router::match_path;
let params = match_path("/tasks/:id", "/tasks/7").unwrap();
assert_eq!(params["id"], "7");
assert!(match_path("/tasks/:id", "/tasks").is_none());