pub enum WhichCaptures {
All,
Implicit,
None,
}
Expand description
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§
Trait Implementations§
Source§impl Clone for WhichCaptures
impl Clone for WhichCaptures
Source§fn clone(&self) -> WhichCaptures
fn clone(&self) -> WhichCaptures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more