Enum regex_test::MatchKind
source · pub enum MatchKind {
All,
LeftmostFirst,
LeftmostLongest,
}
Expand description
The match semantics to use for a search.
When not specified in a test, the default is MatchKind::LeftmostFirst
.
Variants§
All
All possible matches should be reported.
Usually this makes it impossible for non-greedy repetition operators to exist. That is, they behave as greedy repetition operators.
LeftmostFirst
Report only the leftmost match. When there are multiple leftmost
matches that start at the same position, prefer the one that comes
“first” in the pattern. For example, sam|samwise
matches sam
in
samwise
.
This typically corresponds to the semantics implemented by backtracking engines.
LeftmostLongest
Report only the leftmost match. When there are multiple leftmost
matches that start at the same position, prefer the one the longest
match. For example, sam|samwise
matches samwise
in samwise
.
This typically corresponds to the semantics implemented by POSIX engines.
Trait Implementations§
source§impl<'de> Deserialize<'de> for MatchKind
impl<'de> Deserialize<'de> for MatchKind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<MatchKind> for MatchKind
impl PartialEq<MatchKind> for MatchKind
impl Copy for MatchKind
impl Eq for MatchKind
impl StructuralEq for MatchKind
impl StructuralPartialEq for MatchKind
Auto Trait Implementations§
impl RefUnwindSafe for MatchKind
impl Send for MatchKind
impl Sync for MatchKind
impl Unpin for MatchKind
impl UnwindSafe for MatchKind
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.