Struct Group

pub struct Group { pub span: Span, pub kind: GroupKind, pub ast: Box<Ast> }

A grouped regular expression.

This includes both capturing and non-capturing groups. This does not include flag-only groups like (?is), but does contain any group that contains a sub-expression, e.g., (a), (?P<name>a), (?:a) and (?is:a).

Fields

span: Span

The span of this group.

kind: GroupKind

The kind of this group.

ast: Box<Ast>

The regular expression in this group.

Implementations

impl Group

fn flags(&self) -> Option<&Flags>

If this group is non-capturing, then this returns the (possibly empty) set of flags. Otherwise, None is returned.

fn is_capturing(&self) -> bool

Returns true if and only if this group is capturing.

fn capture_index(&self) -> Option<u32>

Returns the capture index of this group, if this is a capturing group.

This returns a capture index precisely when is_capturing is true.

Trait Implementations

impl Clone for Group

fn clone(&self) -> Self

impl Debug for Group

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for Group

impl PartialEq for Group

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for Group

Auto Trait Implementations

impl Freeze for Group

impl RefUnwindSafe for Group

impl Send for Group

impl Sync for Group

impl Unpin for Group

impl UnsafeUnpin for Group

impl UnwindSafe for Group

Blanket Implementations

impl<T> Any for Group where T: 'static + ?Sized,

impl<T> Borrow<T> for Group where T: ?Sized,

impl<T> BorrowMut<T> for Group where T: ?Sized,

impl<T> CloneToUninit for Group where T: Clone,

impl<T> From<T> for Group

impl<T> ToOwned for Group where T: Clone,

impl<T, U> Into<U> for Group where U: From<T>,

impl<T, U> TryFrom<U> for Group where U: Into<T>,

impl<T, U> TryInto<U> for Group where U: TryFrom<T>,