Text of rust.docs.kernel.org › core › str › struct.Matches.html as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Matches in core::str - Rust

Skip to main content Matches core :: str Struct Matches Iterator 1.6.0 · Source pub struct Matches<'a, P: Pattern >( /* private fields */ ); Expand description Created with the method matches . Trait Implementations § 1.2.0 · Source § impl<'a, P> Clone for Matches <'a, P> where P: Pattern <Searcher<'a>: Clone >, Source § fn clone (&self) -> Self Returns a duplicate of the value. Read more 1.0.0 (const: unstable ) · Source § fn clone_from (&mut self, source: &Self) where Self:, Performs copy-assignment from source .

Read more 1.2.0 · Source § impl<'a, P> Debug for Matches <'a, P> where P: Pattern <Searcher<'a>: Debug >, Source § fn fmt (&self, f: &mut Formatter <'_>) -> Result Formats the value using the given formatter. Read more 1.2.0 · Source § impl<'a, P> DoubleEndedIterator for Matches <'a, P> where P: Pattern <Searcher<'a>: DoubleEndedSearcher <'a>>, Source § fn next_back (&mut self) -> Option <&'a str > Removes and returns an element from the end of the iterator.

Read more Source § fn next_chunk_back <const N: usize >( &mut self, ) -> Result <[Self:: Item ; N ], IntoIter <Self:: Item , N>> where Self: Sized , 🔬 This is a nightly-only experimental API. ( iter_next_chunk #98326 ) Advances from the back of the iterator and returns an array containing the next N values in sequence. Read more Source § fn advance_back_by (&mut self, n: usize ) -> Result < () , NonZero < usize >> where Self:: Item :, 🔬 This is a nightly-only experimental API. ( iter_advance_by #77404 ) Advances the iterator from the back by n elements.

Read more 1.37.0 (const: unstable ) · Source § fn nth_back (&mut self, n: usize ) -> Option <Self:: Item > where Self:: Item :, Returns the n th element from the end of the iterator. Read more 1.27.0 (const: unstable ) · Source § fn try_rfold <B, F, R>(&mut self, init: B, f: F) -> R where Self: Sized , F: FnMut (B, Self:: Item ) -> R, R: Try <Output = B>, This is the reverse version of Iterator::try_fold() : it takes elements starting from the back of the iterator.

Read more 1.27.0 (const: unstable ) · Source § fn rfold <B, F>(self, init: B, f: F) -> B where Self: Sized , F: FnMut (B, Self:: Item ) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. Read more 1.27.0 (const: unstable ) · Source § fn rfind <P>(&mut self, predicate: P) -> Option <Self:: Item > where Self: Sized , P: FnMut (&Self:: Item ) -> bool , Self:: Item :, Searches for an element of an iterator from the back that satisfies a predicate.

Read more 1.26.0 · Source § impl<'a, P: Pattern > FusedIterator for Matches <'a, P> 1.2.0 · Source § impl<'a, P: Pattern > Iterator for Matches <'a, P> Source § type Item = &'a str The type of the elements being iterated over. Source § fn next (&mut self) -> Option <&'a str > Advances the iterator and returns the next value. Read more Source § fn next_chunk <const N: usize >( &mut self, ) -> Result <[Self:: Item ; N ], IntoIter <Self:: Item , N>> where Self: Sized , 🔬 This is a nightly-only experimental API. ( iter_next_chunk #98326 ) Advances the iterator and returns an array containing the next N values.

Read more 1.0.0 (const: unstable ) · Source § fn size_hint (&self) -> ( usize , Option < usize >) Returns the bounds on the remaining length of the iterator. Read more 1.0.0 (const: unstable ) · Source § fn count (self) -> usize where Self: Sized , Self:: Item :, Consumes the iterator, counting the number of iterations and returning it. Read more 1.0.0 (const: unstable ) · Source § fn last (self) -> Option <Self:: Item > where Self: Sized , Self:: Item :, Consumes the iterator, returning the last element.

Read more Source § fn advance_by (&mut self, n: usize ) -> Result < () , NonZero < usize >> where Self:: Item :, 🔬 This is a nightly-only experimental API. ( iter_advance_by #77404 ) Advances the iterator by n elements. Read more 1.0.0 (const: unstable ) · Source § fn nth (&mut self, n: usize ) -> Option <Self:: Item > where Self:: Item :, Returns the n th element of the iterator. Read more 1.28.0 (const: unstable ) · Source § fn step_by (self, step: usize ) -> StepBy <Self> ⓘ where Self: Sized , Creates an iterator starting at the same point, but stepping by the given amount at each iteration.

Read more 1.0.0 (const: unstable ) · Source § fn chain <U>(self, other: U) -> Chain <Self, U:: IntoIter > ⓘ where Self: Sized , U: IntoIterator <Item = Self:: Item >, Takes two iterators and creates a new iterator over both in sequence. Read more 1.0.0 (const: unstable ) · Source § fn zip <U>(self, other: U) -> Zip <Self, U:: IntoIter > ⓘ where Self: Sized , U: IntoIterator , ‘Zips up’ two iterators into a single iterator of pairs.

Read more Source § fn intersperse (self, separator: Self:: Item ) -> Intersperse <Self> ⓘ where Self: Sized , Self:: Item : Clone , 🔬 This is a nightly-only experimental API. ( iter_intersperse #79524 ) Creates a new iterator which places a copy of separator between items of the original iterator. Read more Source § fn intersperse_with <G>(self, separator: G) -> IntersperseWith <Self, G> ⓘ where Self: Sized , G: FnMut () -> Self:: Item , 🔬 This is a nightly-only experimental API. ( iter_intersperse #79524 ) Creates a new iterator which places an item generated by separator between items of the original iterator.

Read more 1.0.0 (const: unstable ) · Source § fn map <B, F>(self, f: F) -> Map <Self, F> ⓘ where Self: Sized , F: FnMut (Self:: Item ) -> B, Takes a closure and creates an iterator which calls that closure on each element. Read more 1.21.0 (const: unstable ) · Source § fn for_each <F>(self, f: F) where Self: Sized , F: FnMut (Self:: Item ), Calls a closure on each element of an iterator. Read more 1.0.0 (const: unstable ) · Source § fn filter <P>(self, predicate: P) -> Filter <Self, P> ⓘ where Self: Sized , P: FnMut (&Self:: Item ) -> bool , Creates an iterator which uses a closure to determine if an element should be yielded.

Read more 1.0.0 (const: unstable ) · Source § fn filter_map <B, F>(self, f: F) -> FilterMap <Self, F> ⓘ where Self: Sized , F: FnMut (Self:: Item ) -> Option <B>, Creates an iterator that both filters and maps. Read more 1.0.0 (const: unstable ) · Source § fn enumerate (self) -> Enumerate <Self> ⓘ where Self: Sized , Creates an iterator which gives the current iteration count as well as the next value. Read more 1.0.0 (const: unstable ) · Source § fn peekable (self) -> Peekable <Self> ⓘ where Self: Sized , Creates an iterator which can use the peek and peek_mut methods to look at the next element of the iterator without consuming it.

See their documentation for more information. Read more 1.0.0 (const: unstable ) · Source § fn skip_while <P>(self, predicate: P) -> SkipWhile <Self, P> ⓘ where Self: Sized , P: FnMut (&Self:: Item ) -> bool , Creates an iterator that skip s elements based on a predicate. Read more 1.0.0 (const: unstable ) · Source § fn take_while <P>(self, predicate: P) -> TakeWhile <Self, P> ⓘ where Self: Sized , P: FnMut (&Self:: Item ) -> bool , Creates an iterator that yields elements based on a predicate.

Read more 1.57.0 (const: unstable ) · Source § fn map_while <B, P>(self, predicate: P) -> MapWhile <Self, P> ⓘ where Self: Sized , P: FnMut (Self:: Item ) -> Option <B>, Creates an iterator that both yields elements based on a predicate and maps. Read more 1.0.0 (const: unstable ) · Source § fn skip (self, n: usize ) -> Skip <Self> ⓘ where Self: Sized , Creates an iterator that skips the first n elements. Read more 1.0.0 (const: unstable ) · Source § fn take (self, n: usize ) -> Take <Self> ⓘ where Self: Sized , Creates an iterator that yields the first n elements, or fewer if the underlying iterator ends sooner.

Read more 1.0.0 (const: unstable ) · Source § fn scan <St, B, F>(self, initial_state: St, f: F) -> Scan <Self, St, F> ⓘ where Self: Sized , F: FnMut ( &mut St , Self:: I

The rest of this page is on the live site.