pub struct Captures<'t> { /* private fields */ }Expand description
A set of captured substrings from a single match
Implementations§
Source§impl<'t> Captures<'t>
impl<'t> Captures<'t>
Sourcepub fn new(text: &'t str, full_match: (usize, usize), num_groups: usize) -> Self
pub fn new(text: &'t str, full_match: (usize, usize), num_groups: usize) -> Self
Create a new Captures with the full match
Sourcepub fn get(&self, index: usize) -> Option<&'t str>
pub fn get(&self, index: usize) -> Option<&'t str>
Get the matched substring for a capture group
Index 0 returns the full match, indices 1+ return capture groups
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