Struct CaptureMatches

pub struct CaptureMatches<'r, 'h> { /* private fields */ }

An iterator over all non-overlapping capture matches in a haystack.

This iterator yields Captures values. The iterator stops when no more matches can be found.

'r is the lifetime of the compiled regular expression and 'h is the lifetime of the matched string.

This iterator is created by Regex::captures_iter.

Time complexity

Note that since an iterator runs potentially many searches on the haystack and since each search has worst case O(m * n) time complexity, the overall worst case time complexity for iteration is O(m * n^2).

Trait Implementations

impl<'r, 'h> Debug for CaptureMatches<'r, 'h>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'r, 'h> FusedIterator for CaptureMatches<'r, 'h>

impl<'r, 'h> Iterator for CaptureMatches<'r, 'h>

type Item = Captures<'h>;
fn next(&mut self) -> Option<Captures<'h>>
fn count(self) -> usize

Auto Trait Implementations

impl<'r, 'h> Freeze for CaptureMatches<'r, 'h>

impl<'r, 'h> RefUnwindSafe for CaptureMatches<'r, 'h>

impl<'r, 'h> Send for CaptureMatches<'r, 'h>

impl<'r, 'h> Sync for CaptureMatches<'r, 'h>

impl<'r, 'h> Unpin for CaptureMatches<'r, 'h>

impl<'r, 'h> UnsafeUnpin for CaptureMatches<'r, 'h>

impl<'r, 'h> UnwindSafe for CaptureMatches<'r, 'h>

Blanket Implementations

impl<I> IntoIterator for CaptureMatches<'r, 'h> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

impl<T> Any for CaptureMatches<'r, 'h> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for CaptureMatches<'r, 'h> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for CaptureMatches<'r, 'h> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for CaptureMatches<'r, 'h>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for CaptureMatches<'r, 'h> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for CaptureMatches<'r, 'h> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for CaptureMatches<'r, 'h> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>