pub struct Captures<'t, I> { /* private fields */ }
Expand description
Captures represents a group of captured sub-slice for a single match.
The 0th capture always corresponds to the entire match. Each subsequent index corresponds to the next capture group in the regex. If a capture group is named, then the matched sub-slice is also available via the name method. (Note that the 0th capture is always unnamed and so must be accessed with the get method.)
't
is the lifetime of the matched slice.
Implementations§
Source§impl<'t, I> Captures<'t, I>
impl<'t, I> Captures<'t, I>
Sourcepub fn get(&self, index: usize) -> Option<Match<'t, I>>
pub fn get(&self, index: usize) -> Option<Match<'t, I>>
Returns the match associated with the capture group at index i. If i does not correspond to a capture group, or if the capture group did not participate in the match, then None is returned.
Trait Implementations§
Auto Trait Implementations§
impl<'t, I> Freeze for Captures<'t, I>
impl<'t, I> RefUnwindSafe for Captures<'t, I>where
I: RefUnwindSafe,
impl<'t, I> !Send for Captures<'t, I>
impl<'t, I> !Sync for Captures<'t, I>
impl<'t, I> Unpin for Captures<'t, I>
impl<'t, I> UnwindSafe for Captures<'t, I>where
I: RefUnwindSafe,
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