Struct regex::SetMatches
source · [−]pub struct SetMatches { /* private fields */ }
Expand description
A set of matches returned by a regex set.
Implementations
sourceimpl SetMatches
impl SetMatches
sourcepub fn matched_any(&self) -> bool
pub fn matched_any(&self) -> bool
Whether this set contains any matches.
sourcepub fn matched(&self, regex_index: usize) -> bool
pub fn matched(&self, regex_index: usize) -> bool
Whether the regex at the given index matched.
The index for a regex is determined by its insertion order upon the
initial construction of a RegexSet
, starting at 0
.
Panics
If regex_index
is greater than or equal to self.len()
.
sourcepub fn iter(&self) -> SetMatchesIter<'_>ⓘNotable traits for SetMatchesIter<'a>impl<'a> Iterator for SetMatchesIter<'a> type Item = usize;
pub fn iter(&self) -> SetMatchesIter<'_>ⓘNotable traits for SetMatchesIter<'a>impl<'a> Iterator for SetMatchesIter<'a> type Item = usize;
Returns an iterator over indexes in the regex that matched.
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.
Trait Implementations
sourceimpl Clone for SetMatches
impl Clone for SetMatches
sourcefn clone(&self) -> SetMatches
fn clone(&self) -> SetMatches
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SetMatches
impl Debug for SetMatches
sourceimpl IntoIterator for SetMatches
impl IntoIterator for SetMatches
sourceimpl<'a> IntoIterator for &'a SetMatches
impl<'a> IntoIterator for &'a SetMatches
Auto Trait Implementations
impl RefUnwindSafe for SetMatches
impl Send for SetMatches
impl Sync for SetMatches
impl Unpin for SetMatches
impl UnwindSafe for SetMatches
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more