Struct Group

struct Group { ... }

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: &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: &Self) -> bool

Returns true if and only if this group is capturing.

fn capture_index(self: &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.

impl Clone for Group

fn clone(self: &Self) -> Group

impl Debug for Group

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

impl Eq for Group

impl Freeze for Group

impl PartialEq for Group

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

impl RefUnwindSafe for Group

impl Send for Group

impl StructuralPartialEq for Group

impl Sync for Group

impl Unpin for Group

impl UnsafeUnpin for Group

impl UnwindSafe for Group

impl<T> Any for Group

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Group

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Group

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Group

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Group

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Group

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Group

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Group

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Group

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>