pub struct Capture {
pub index: u32,
pub name: Option<Box<str>>,
pub sub: Box<Hir>,
}
Expand description
The high-level intermediate representation for a capturing group.
A capturing group always has an index and a child expression. It may
also have a name associated with it (e.g., (?P<foo>\w)
), but it’s not
necessary.
Note that there is no explicit representation of a non-capturing group
in a Hir
. Instead, non-capturing grouping is handled automatically by
the recursive structure of the Hir
itself.
Fields§
§index: u32
The capture index of the capture.
name: Option<Box<str>>
The name of the capture, if it exists.
sub: Box<Hir>
The expression inside the capturing group, which may be empty.
Trait Implementations§
impl Eq for Capture
impl StructuralPartialEq for Capture
Auto Trait Implementations§
impl Freeze for Capture
impl RefUnwindSafe for Capture
impl Send for Capture
impl Sync for Capture
impl Unpin for Capture
impl UnwindSafe for Capture
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)