pub fn capture_names(&self) -> HashSet<&str> {
        fn capture_names_impl(tokens: &[MatcherToken]) -> HashSet<&str> {
            tokens
                .iter()
                .fold(HashSet::new(), |mut acc: HashSet<&str>, token| {
                    match token {
                        MatcherToken::Exact(_)
                        | MatcherToken::End
                        => {}
                        MatcherToken::Capture(capture) => match &capture {
                            CaptureVariant::ManyNamed(name)
                            | CaptureVariant::Named(name)
                            | CaptureVariant::NumberedNamed { name, .. } => {
                                acc.insert(&name);
                            }
                        },
                    }
                    acc
                })
        }
        capture_names_impl(&self.tokens)
    }
/// 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.
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.
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 .
pub fn capture_names(&self) -> HashSet<&str> {
        fn capture_names_impl(tokens: &[MatcherToken]) -> HashSet<&str> {
            tokens
                .iter()
                .fold(HashSet::new(), |mut acc: HashSet<&str>, token| {
                    match token {
                        MatcherToken::Exact(_)
                        | MatcherToken::End
                        => {}
                        MatcherToken::Capture(capture) => match &capture {
                            CaptureVariant::ManyNamed(name)
                            | CaptureVariant::Named(name)
                            | CaptureVariant::NumberedNamed { name, .. } => {
                                acc.insert(&name);
                            }
                        },
                    }
                    acc
                })
        }
        capture_names_impl(&self.tokens)
    }
pub fn capture_names ( & self ) -> HashSet < & str > { fn capture_names_impl ( tokens : & [ MatcherToken ] ) -> HashSet < & str > { tokens . iter ( ) . fold ( HashSet :: new ( ) , | mut acc : HashSet < & str > , token | { match token { MatcherToken :: Exact ( _ ) | MatcherToken :: End => { } MatcherToken :: Capture ( capture ) => match & capture { CaptureVariant :: ManyNamed ( name ) | CaptureVariant :: Named ( name ) | CaptureVariant :: NumberedNamed { name , .. } => { acc . insert ( & name ) ; } } , } acc } ) } capture_names_impl ( & self . tokens ) }
Gets a set of all names that will be captured.
Gets a set of all names that will be captured .
&self
&self