Enum regex_automata::util::captures::GroupInfoErrorKind

source ·
enum GroupInfoErrorKind {
    TooManyPatterns {
        err: PatternIDError,
    },
    TooManyGroups {
        pattern: PatternID,
        minimum: usize,
    },
    MissingGroups {
        pattern: PatternID,
    },
    FirstMustBeUnnamed {
        pattern: PatternID,
    },
    Duplicate {
        pattern: PatternID,
        name: String,
    },
}
Expand description

The kind of error that occurs when building a GroupInfo fails.

We keep this un-exported because it’s not clear how useful it is to export it.

Variants§

§

TooManyPatterns

This occurs when too many patterns have been added. i.e., It would otherwise overflow a PatternID.

Fields

§

TooManyGroups

This occurs when too many capturing groups have been added for a particular pattern.

Fields

§pattern: PatternID

The ID of the pattern that had too many groups.

§minimum: usize

The minimum number of groups that the caller has tried to add for a pattern.

§

MissingGroups

An error that occurs when a pattern has no capture groups. Either the group info must be empty, or all patterns must have at least one group (corresponding to the unnamed group for the entire pattern).

Fields

§pattern: PatternID

The ID of the pattern that had no capturing groups.

§

FirstMustBeUnnamed

An error that occurs when one tries to provide a name for the capture group at index 0. This capturing group must currently always be unnamed.

Fields

§pattern: PatternID

The ID of the pattern that was found to have a named first capturing group.

§

Duplicate

An error that occurs when duplicate capture group names for the same pattern are added.

NOTE: At time of writing, this error can never occur if you’re using regex-syntax, since the parser itself will reject patterns with duplicate capture group names. This error can only occur when the builder is used to hand construct NFAs.

Fields

§pattern: PatternID

The pattern in which the duplicate capture group name was found.

§name: String

The duplicate name.

Trait Implementations§

source§

impl Clone for GroupInfoErrorKind

source§

fn clone(&self) -> GroupInfoErrorKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GroupInfoErrorKind

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.