pub struct CaptureState { /* private fields */ }Expand description
Capture group state during matching.
Implementations§
Source§impl CaptureState
impl CaptureState
Sourcepub fn register_name(&mut self, name: String, index: usize)
pub fn register_name(&mut self, name: String, index: usize)
Register a named group.
Sourcepub fn start_capture(&mut self, group: usize, pos: usize)
pub fn start_capture(&mut self, group: usize, pos: usize)
Start a capture at a position.
Sourcepub fn end_capture(&mut self, group: usize, pos: usize)
pub fn end_capture(&mut self, group: usize, pos: usize)
End a capture at a position.
Sourcepub fn get_text<'a>(&self, index: usize, text: &'a str) -> Option<&'a str>
pub fn get_text<'a>(&self, index: usize, text: &'a str) -> Option<&'a str>
Get the captured text for a group.
Sourcepub fn set_full_match(&mut self, start: usize, end: usize)
pub fn set_full_match(&mut self, start: usize, end: usize)
Set the full match (group 0).
Sourcepub fn with_offset(&self, offset: usize) -> Self
pub fn with_offset(&self, offset: usize) -> Self
Clone with a new position offset.
Trait Implementations§
Source§impl Clone for CaptureState
impl Clone for CaptureState
Source§fn clone(&self) -> CaptureState
fn clone(&self) -> CaptureState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CaptureState
impl RefUnwindSafe for CaptureState
impl Send for CaptureState
impl Sync for CaptureState
impl Unpin for CaptureState
impl UnsafeUnpin for CaptureState
impl UnwindSafe for CaptureState
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