Struct SetMatchesIntoIter

pub struct SetMatchesIntoIter { /* private fields */ }

An owned iterator over the set of matches from a regex set.

This will always produces matches in ascending order of index, where the index corresponds to the index of the regex that matched with respect to its position when initially building the set.

This iterator is created by calling SetMatches::into_iter via the IntoIterator trait. This is automatically done in for loops.

Example

use regex::RegexSet;

let set = RegexSet::new([
    r"[0-9]",
    r"[a-z]",
    r"[A-Z]",
    r"\p{Greek}",
]).unwrap();
let hay = "βa1";
let mut matches = vec![];
for index in set.matches(hay) {
    matches.push(index);
}
assert_eq!(matches, vec![0, 1, 3]);

Trait Implementations

impl Debug for SetMatchesIntoIter

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

impl DoubleEndedIterator for SetMatchesIntoIter

fn next_back(&mut self) -> Option<usize>

impl FusedIterator for SetMatchesIntoIter

impl Iterator for SetMatchesIntoIter

type Item = usize;
fn next(&mut self) -> Option<usize>
fn size_hint(&self) -> (usize, Option<usize>)

Auto Trait Implementations

impl Freeze for SetMatchesIntoIter

impl RefUnwindSafe for SetMatchesIntoIter

impl Send for SetMatchesIntoIter

impl Sync for SetMatchesIntoIter

impl Unpin for SetMatchesIntoIter

impl UnsafeUnpin for SetMatchesIntoIter

impl UnwindSafe for SetMatchesIntoIter

Blanket Implementations

impl<I> IntoIterator for SetMatchesIntoIter where I: Iterator,

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

impl<T> Any for SetMatchesIntoIter where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for SetMatchesIntoIter where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for SetMatchesIntoIter where T: ?Sized,

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

impl<T> From<T> for SetMatchesIntoIter

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for SetMatchesIntoIter 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 SetMatchesIntoIter where U: Into<T>,

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

impl<T, U> TryInto<U> for SetMatchesIntoIter where U: TryFrom<T>,

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