Enum WhichCaptures

enum WhichCaptures

A configuration indicating which kinds of State::Capture states to include.

This configuration can be used with Config::which_captures to control which capture states are compiled into a Thompson NFA.

The default configuration is WhichCaptures::All.

Variants

All

All capture states, including those corresponding to both implicit and explicit capture groups, are included in the Thompson NFA.

Implicit

Only capture states corresponding to implicit capture groups are included. Implicit capture groups appear in every pattern implicitly and correspond to the overall match of a pattern.

This is useful when one only cares about the overall match of a pattern. By excluding capture states from explicit capture groups, one might be able to reduce the memory usage of a multi-pattern regex substantially if it was otherwise written to have many explicit capture groups.

None

No capture states are compiled into the Thompson NFA.

This is useful when capture states are either not needed (for example, if one is only trying to build a DFA) or if they aren't supported (for example, a reverse NFA).

Implementations

impl WhichCaptures

fn is_none(self: &Self) -> bool

Returns true if this configuration indicates that no capture states should be produced in an NFA.

fn is_any(self: &Self) -> bool

Returns true if this configuration indicates that some capture states should be added to an NFA. Note that this might only include capture states for implicit capture groups.

impl Clone for WhichCaptures

fn clone(self: &Self) -> WhichCaptures

impl Copy for WhichCaptures

impl Debug for WhichCaptures

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

impl Default for WhichCaptures

fn default() -> WhichCaptures

impl Freeze for WhichCaptures

impl RefUnwindSafe for WhichCaptures

impl Send for WhichCaptures

impl Sync for WhichCaptures

impl Unpin for WhichCaptures

impl UnsafeUnpin for WhichCaptures

impl UnwindSafe for WhichCaptures

impl<T> Any for WhichCaptures

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for WhichCaptures

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

impl<T> BorrowMut for WhichCaptures

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

impl<T> CloneToUninit for WhichCaptures

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

impl<T> From for WhichCaptures

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for WhichCaptures

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

impl<T, U> Into for WhichCaptures

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 WhichCaptures

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

impl<T, U> TryInto for WhichCaptures

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