pub fn best_match<'a, 'b>(&'a self, path: &'b str) -> Option<Match<'a, 'b, Handler>> {
        self.routes.iter().find_map(|(route, handler)| {
            route.matches(path).map(|captures| Match {
                path,
                route,
                captures,
                handler,
            })
        })
    }
/// Returns the single best route match as defined by the sorting
/// rules. To compare any two routes, step through each
/// [`Segment`][crate::Segment] and find the first pair that are not equal,
/// according to: `Exact > Param > Wildcard > (dots and slashes)`
/// As a result, `/hello` > `/:param` > `/*`.  Because we can sort
/// the routes before encountering a path, we evaluate them from
/// highest to lowest weight and an early return as soon as we
/// find a match.
///
/// ```rust
/// let mut router = routefinder::Router::new();
/// router.add("*", 0).unwrap();
/// router.add("/:param", 1).unwrap();
/// router.add("/hello", 2).unwrap();
/// assert_eq!(*router.best_match("/hello").unwrap(), 2);
/// assert_eq!(*router.best_match("/hey").unwrap(), 1);
/// assert_eq!(router.best_match("/hey").unwrap().captures().get("param"), Some("hey"));
/// assert_eq!(*router.best_match("/hey/there").unwrap(), 0);
/// assert_eq!(*router.best_match("/").unwrap(), 0);
/// ```
Returns the single best route match as defined by the sorting
rules.


Returns the single best route match as defined by the sorting rules .
pub fn best_match<'a, 'b>(&'a self, path: &'b str) -> Option<Match<'a, 'b, Handler>> {
        self.routes.iter().find_map(|(route, handler)| {
            route.matches(path).map(|captures| Match {
                path,
                route,
                captures,
                handler,
            })
        })
    }
pub fn best_match < ' a , ' b > ( & ' a self , path : & ' b str ) -> Option < Match < ' a , ' b , Handler > > { self . routes . iter ( ) . find_map ( | ( route , handler ) | { route . matches ( path ) . map ( | captures | Match { path , route , captures , handler , } ) } ) }
Returns the single best route match as defined by the sorting
rules.
Returns the single best route match as defined by the sorting rules .
&'a self
path
&'b str