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: SpanThe span of this group.
kind: GroupKindThe 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,
Noneis returned.fn is_capturing(&self) -> boolReturns 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_capturingistrue.
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,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Group
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Group
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Group
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Group
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Group
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Group
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Group
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Group
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>