pub struct Captures<'h>(/* private fields */);Expand description
A successful match and its capture groups.
Borrows the haystack, so it never escapes the call that produced it —
MatchResult is the owned form that outlives a match.
Implementations§
Source§impl<'h> Captures<'h>
impl<'h> Captures<'h>
Sourcepub fn start(&self) -> usize
pub fn start(&self) -> usize
Byte offset where the whole match begins. Non-zero whenever the leftmost match starts part-way into the haystack.
Sourcepub fn end(&self) -> usize
pub fn end(&self) -> usize
Byte offset just past the whole match — where the next search starts.
Sourcepub fn group_count(&self) -> usize
pub fn group_count(&self) -> usize
Number of groups, group 0 included; always at least 1.
Trait Implementations§
Auto Trait Implementations§
impl<'h> Freeze for Captures<'h>
impl<'h> RefUnwindSafe for Captures<'h>
impl<'h> Send for Captures<'h>
impl<'h> Sync for Captures<'h>
impl<'h> Unpin for Captures<'h>
impl<'h> UnsafeUnpin for Captures<'h>
impl<'h> UnwindSafe for Captures<'h>
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