Struct TryMatchesIter

pub struct TryMatchesIter<'h, F> { /* private fields */ }

An iterator over all non-overlapping matches for a fallible search.

The iterator yields a Result<Match, MatchError> value until no more matches could be found.

The type parameters are as follows:

The lifetime parameters come from the Input type:

When possible, prefer the iterators defined on the regex engine you're using. This tries to abstract over the regex engine and is thus a bit more unwieldy to use.

This iterator is created by Searcher::into_matches_iter.

Implementations

impl<'h, F> TryMatchesIter<'h, F>

fn infallible(self) -> MatchesIter<'h, F>

Return an infallible version of this iterator.

Any item yielded that corresponds to an error results in a panic. This is useful if your underlying regex engine is configured in a way that it is guaranteed to never return an error.

fn input<'i>(&'i self) -> &'i Input<'h>

Returns the current Input used by this iterator.

The Input returned is generally equivalent to the one used to construct this iterator, but its start position may be different to reflect the start of the next search to be executed.

Trait Implementations

impl<'h, F> Debug for TryMatchesIter<'h, F>

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

impl<'h, F> Iterator for TryMatchesIter<'h, F> where F: FnMut(&Input<'_>) -> Result<Option<Match>, MatchError>,

type Item = Result<Match, MatchError>;
fn next(&mut self) -> Option<Result<Match, MatchError>>

Auto Trait Implementations

impl<'h, F> Freeze for TryMatchesIter<'h, F> where F: Freeze,

impl<'h, F> RefUnwindSafe for TryMatchesIter<'h, F> where F: RefUnwindSafe,

impl<'h, F> Send for TryMatchesIter<'h, F> where F: Send,

impl<'h, F> Sync for TryMatchesIter<'h, F> where F: Sync,

impl<'h, F> Unpin for TryMatchesIter<'h, F> where F: Unpin,

impl<'h, F> UnsafeUnpin for TryMatchesIter<'h, F> where F: UnsafeUnpin,

impl<'h, F> UnwindSafe for TryMatchesIter<'h, F> where F: UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for TryMatchesIter<'h, F> where I: Iterator,

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

impl<T> Any for TryMatchesIter<'h, F> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for TryMatchesIter<'h, F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for TryMatchesIter<'h, F> where T: ?Sized,

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

impl<T> From<T> for TryMatchesIter<'h, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for TryMatchesIter<'h, F> 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 TryMatchesIter<'h, F> where U: Into<T>,

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

impl<T, U> TryInto<U> for TryMatchesIter<'h, F> where U: TryFrom<T>,

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