pub trait Matcher: Send + Sync {
    fn is_match(&self, segment: &str) -> bool;

    fn capture<'a>(&'a self, _segment: &str) -> Option<Capture<'a>> { ... }
}
Expand description

Matching trait to enable generic route matching algorithms.

This trait backs the main tree, enabling custom segment matching based on the needs of the end developer. In many cases it’s wasteful to check for things like RegEx, especially when all routes will only be static (as an example).

Required Methods

Determines whether an incoming segment is a match for a base segment.

Provided Methods

Retrieves a potential capture from a segment.

Implementors

Blanket implementation of Matcher for pure functions.

Pure functions are assumed to not have a capture group, as there’s no way to directly name them at this point (unless derived from the input).