pub struct RouteMatcher {
pub tokens: Vec<MatcherToken>,
pub settings: MatcherSettings,
}
Expand description
Attempts to match routes, transform the route to Component props and render that Component.
Fields§
§tokens: Vec<MatcherToken>
Tokens used to determine how the matcher will match a route string.
settings: MatcherSettings
Settings
Implementations§
Source§impl RouteMatcher
impl RouteMatcher
Sourcepub fn try_from(i: &str) -> Result<Self, PrettyParseError<'_>>
pub fn try_from(i: &str) -> Result<Self, PrettyParseError<'_>>
Attempt to create a RouteMatcher from a “matcher string”.
Sourcepub fn new(
i: &str,
settings: MatcherSettings,
) -> Result<Self, PrettyParseError<'_>>
pub fn new( i: &str, settings: MatcherSettings, ) -> Result<Self, PrettyParseError<'_>>
Creates a new Matcher with settings.
Sourcepub fn capture_route_into_map<'a, 'b: 'a>(
&'b self,
i: &'a str,
) -> IResult<&'a str, Captures<'a>>
pub fn capture_route_into_map<'a, 'b: 'a>( &'b self, i: &'a str, ) -> IResult<&'a str, Captures<'a>>
Match a route string, collecting the results into a map.
Sourcepub fn capture_route_into_vec<'a, 'b: 'a>(
&'b self,
i: &'a str,
) -> IResult<&'a str, Vec<String>>
pub fn capture_route_into_vec<'a, 'b: 'a>( &'b self, i: &'a str, ) -> IResult<&'a str, Vec<String>>
Match a route string, collecting the results into a vector.
Sourcepub fn capture_names(&self) -> HashSet<&str>
pub fn capture_names(&self) -> HashSet<&str>
Gets a set of all names that will be captured. This is useful in determining if a given struct will be able to be populated by a given path matcher before being given a concrete path to match.
Trait Implementations§
Source§impl Clone for RouteMatcher
impl Clone for RouteMatcher
Source§fn clone(&self) -> RouteMatcher
fn clone(&self) -> RouteMatcher
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RouteMatcher
impl Debug for RouteMatcher
Source§impl PartialEq for RouteMatcher
impl PartialEq for RouteMatcher
impl StructuralPartialEq for RouteMatcher
Auto Trait Implementations§
impl Freeze for RouteMatcher
impl RefUnwindSafe for RouteMatcher
impl Send for RouteMatcher
impl Sync for RouteMatcher
impl Unpin for RouteMatcher
impl UnwindSafe for RouteMatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.