pub struct Captures<'s> { /* private fields */ }Expand description
Capture groups for one match. Group zero is the whole match.
Captures own their ranges and borrow only the input, so they may be retained after a scan callback returns. Groups are addressed by number.
Implementations§
Source§impl<'s> Captures<'s>
impl<'s> Captures<'s>
Sourcepub fn get(&self, index: usize) -> Option<Match<'s>>
pub fn get(&self, index: usize) -> Option<Match<'s>>
Returns a participating group, or None for an unmatched or absent group.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether there are no groups. Successful matches include group zero.
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = Option<Match<'s>>> + '_
pub fn iter(&self) -> impl ExactSizeIterator<Item = Option<Match<'s>>> + '_
Visits groups in numerical order, including nonparticipating groups.
Trait Implementations§
impl<'s> Eq for Captures<'s>
impl<'s> StructuralPartialEq for Captures<'s>
Auto Trait Implementations§
impl<'s> Freeze for Captures<'s>
impl<'s> RefUnwindSafe for Captures<'s>
impl<'s> Send for Captures<'s>
impl<'s> Sync for Captures<'s>
impl<'s> Unpin for Captures<'s>
impl<'s> UnsafeUnpin for Captures<'s>
impl<'s> UnwindSafe for Captures<'s>
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