Lines Matching refs:Match
25 /// Match represents a single match of a regex in a haystack.
29 pub struct Match<'t> {
35 impl<'t> Match<'t> {
63 fn new(haystack: &'t str, start: usize, end: usize) -> Match<'t> {
64 Match { text: haystack, start, end }
68 impl<'t> From<Match<'t>> for &'t str {
69 fn from(m: Match<'t>) -> &'t str {
74 impl<'t> From<Match<'t>> for Range<usize> {
75 fn from(m: Match<'t>) -> Range<usize> {
222 pub fn find<'t>(&self, text: &'t str) -> Option<Match<'t>> {
652 ) -> Option<Match<'t>> {
656 .map(|(s, e)| Match::new(text, s, e))
673 ) -> Option<Match<'t>> {
688 ) -> Option<Match<'t>> {
692 .map(|(s, e)| Match::new(text, s, e))
706 ) -> Option<Match<'t>> {
948 pub fn get(&self, i: usize) -> Option<Match<'t>> {
949 self.locs.pos(i).map(|(s, e)| Match::new(self.text, s, e))
954 pub fn name(&self, name: &str) -> Option<Match<'t>> {
1088 type Item = Option<Match<'t>>;
1090 fn next(&mut self) -> Option<Option<Match<'t>>> {
1093 .map(|cap| cap.map(|(s, e)| Match::new(self.caps.text, s, e)))
1137 /// The iterator yields a `Match` value. The iterator stops when no more
1146 type Item = Match<'t>;
1148 fn next(&mut self) -> Option<Match<'t>> {
1150 self.0.next().map(|(s, e)| Match::new(text, s, e))