#[repr(u8)]
pub enum MatchKind {
Standard,
LeftmostLongest,
LeftmostFirst,
}
Expand description
A search option of the Aho-Corasick automaton
specified in DoubleArrayAhoCorasickBuilder::match_kind
.
Variants
Standard
The standard match semantics, which enables
find_iter()
,
find_overlapping_iter()
, and
find_overlapping_no_suffix_iter()
.
Patterns are reported in the order that follows the normal behaviour of the Aho-Corasick
algorithm.
LeftmostLongest
The leftmost-longest match semantics, which enables
leftmost_find_iter()
.
When multiple patterns are started from the same positions, the longest pattern will be
reported. For example, when matching patterns ab|a|abcd
over abcd
, abcd
will be
reported.
LeftmostFirst
The leftmost-first match semantics, which enables
leftmost_find_iter()
.
When multiple patterns are started from the same positions, the pattern that is registered
earlier will be reported. For example, when matching patterns ab|a|abcd
over abcd
,
ab
will be reported.
Trait Implementations
sourceimpl Serializable for MatchKind
impl Serializable for MatchKind
sourcefn serialize_to_vec(&self, dst: &mut Vec<u8>)
fn serialize_to_vec(&self, dst: &mut Vec<u8>)
A function called during serialization. Read more
sourcefn deserialize_from_slice(src: &[u8]) -> (Self, &[u8])
fn deserialize_from_slice(src: &[u8]) -> (Self, &[u8])
A function called during deserialization. This function must return the pair of the struct and the rest slice. Read more
sourcefn serialized_bytes() -> usize
fn serialized_bytes() -> usize
Returns the size of serialized data.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more