pub fn new(
        captures: &'captures Captures<'keys, 'values>,
        route: &'route RouteSpec,
    ) -> Option<Self> {
        let all_params_matched = route
            .segments()
            .iter()
            .filter_map(|s| match s {
                Segment::Param(s) => Some(s),
                _ => None,
            })
            .eq(captures.params().iter().map(|c| c.name()));

        if !all_params_matched {
            return None;
        }

        if captures.wildcard().is_some()
            && !matches!(route.segments().last(), Some(Segment::Wildcard))
        {
            return None;
        }

        Some(Self { route, captures })
    }
/// Attempts to build a new ReverseMatch. Returns None if the
/// match was unsuccessful.
Attempts to build a new ReverseMatch. Returns None if the
match was unsuccessful.
Attempts to build a new ReverseMatch . Returns None if the match was unsuccessful .
pub fn new(
        captures: &'captures Captures<'keys, 'values>,
        route: &'route RouteSpec,
    ) -> Option<Self> {
        let all_params_matched = route
            .segments()
            .iter()
            .filter_map(|s| match s {
                Segment::Param(s) => Some(s),
                _ => None,
            })
            .eq(captures.params().iter().map(|c| c.name()));
        if !all_params_matched {
            return None;
        }
        if captures.wildcard().is_some()
            && !matches!(route.segments().last(), Some(Segment::Wildcard))
        {
            return None;
        }
        Some(Self { route, captures })
    }
pub fn new ( captures : & ' captures Captures < ' keys , ' values > , route : & ' route RouteSpec , ) -> Option < Self > { let all_params_matched = route . segments ( ) . iter ( ) . filter_map ( | s | match s { Segment :: Param ( s ) => Some ( s ) , _ => None , } ) . eq ( captures . params ( ) . iter ( ) . map ( | c | c . name ( ) ) ) ; if ! all_params_matched { return None ; } if captures . wildcard ( ) . is_some ( ) && ! matches ! ( route segments ( ) last ( ) Some ( Segment Wildcard ) ) { return None ; } Some ( Self { route , captures } ) }
Attempts to build a new ReverseMatch.
Attempts to build a new ReverseMatch .
captures
&'captures Captures<'keys, 'values>
route
&'route RouteSpec