Struct HalfMatchesIter
pub struct HalfMatchesIter<'h, F>(/* private field */);
An iterator over all non-overlapping half matches for an infallible search.
The iterator yields a HalfMatch value until no more matches could be
found.
The type parameters are as follows:
Frepresents the type of a closure that executes the search.
The lifetime parameters come from the Input type:
'his the lifetime of the underlying haystack.
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_half_matches_iter and
then calling TryHalfMatchesIter::infallible.
Implementations
impl<'h, F> HalfMatchesIter<'h, F>
fn input<'i>(&'i self) -> &'i Input<'h>Returns the current
Inputused by this iterator.The
Inputreturned 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> Iterator for HalfMatchesIter<'h, F>
where
F: FnMut(&Input<'_>) -> Result<Option<HalfMatch>, MatchError>,
type Item = HalfMatch;fn next(&mut self) -> Option<HalfMatch>
impl<'h, F: Debug> Debug for HalfMatchesIter<'h, F>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<'h, F> Freeze for HalfMatchesIter<'h, F>
where
TryHalfMatchesIter<'h, F>: Freeze,
impl<'h, F> RefUnwindSafe for HalfMatchesIter<'h, F>
where
TryHalfMatchesIter<'h, F>: RefUnwindSafe,
impl<'h, F> Send for HalfMatchesIter<'h, F>
where
TryHalfMatchesIter<'h, F>: Send,
impl<'h, F> Sync for HalfMatchesIter<'h, F>
where
TryHalfMatchesIter<'h, F>: Sync,
impl<'h, F> Unpin for HalfMatchesIter<'h, F>
where
TryHalfMatchesIter<'h, F>: Unpin,
impl<'h, F> UnsafeUnpin for HalfMatchesIter<'h, F>
where
TryHalfMatchesIter<'h, F>: UnsafeUnpin,
impl<'h, F> UnwindSafe for HalfMatchesIter<'h, F>
where
TryHalfMatchesIter<'h, F>: UnwindSafe,
Blanket Implementations
impl<I> IntoIterator for HalfMatchesIter<'h, F>
where
I: Iterator,
type Item = <I as Iterator>::Item;type IntoIter = I;fn into_iter(self) -> I
impl<T> Any for HalfMatchesIter<'h, F>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for HalfMatchesIter<'h, F>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for HalfMatchesIter<'h, F>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for HalfMatchesIter<'h, F>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for HalfMatchesIter<'h, F>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for HalfMatchesIter<'h, F>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for HalfMatchesIter<'h, F>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>