Struct sharp_pencil::routing::Matcher
source · [−]Expand description
The matcher holds the url regex object.
Fields
regex: Regex
matches_query: bool
Implementations
Trait Implementations
sourceimpl<'a> From<&'a str> for Matcher
impl<'a> From<&'a str> for Matcher
Rule strings basically are just normal URL paths with placeholders in
the format <name:converter>
where the converter are optional.
Currently we support following converters:
- string(default)
- int
- float
- path
If no converter is defined the default
converter is used which means string
.
URL rules that end with a slash are branch URLs, others are leaves. All branch URLs that are matched without a trailing slash will trigger a redirect to the same URL with the missing slash appended. We have a url without a trailing slash for branch url rule. So we redirect to the same url but with a trailing slash.
Auto Trait Implementations
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnwindSafe for Matcher
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more