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 moresource§impl Debug for WhichCaptures
impl Debug for WhichCaptures
source§impl Default for WhichCaptures
impl Default for WhichCaptures
source§fn default() -> WhichCaptures
fn default() -> WhichCaptures
impl Copy for WhichCaptures
Auto Trait Implementations§
impl Freeze for WhichCaptures
impl RefUnwindSafe for WhichCaptures
impl Send for WhichCaptures
impl Sync for WhichCaptures
impl Unpin for WhichCaptures
impl UnwindSafe for WhichCaptures
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)