pub struct Captures<'t>(/* private fields */);
Expand description
A set of capture groups found for a regex.
Implementations§
Source§impl<'t> Captures<'t>
impl<'t> Captures<'t>
Sourcepub fn get(&self, i: usize) -> Option<Match<'t>>
pub fn get(&self, i: usize) -> Option<Match<'t>>
Get the capture group by its index in the regex.
If there is no match for that group or the index does not correspond to a group, None
is
returned. The index 0 returns the whole match.
Sourcepub fn iter<'c>(&'c self) -> SubCaptureMatches<'c, 't> ⓘ
pub fn iter<'c>(&'c self) -> SubCaptureMatches<'c, 't> ⓘ
Iterate over the captured groups in order in which they appeared in the regex. The first capture corresponds to the whole match.
Trait Implementations§
Auto Trait Implementations§
impl<'t> Freeze for Captures<'t>
impl<'t> RefUnwindSafe for Captures<'t>
impl<'t> Send for Captures<'t>
impl<'t> Sync for Captures<'t>
impl<'t> Unpin for Captures<'t>
impl<'t> UnwindSafe for Captures<'t>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more