Module automaton

Source
Expand description

Provides Automaton trait for abstracting over Aho-Corasick automata.

The Automaton trait provides a way to write generic code over any Aho-Corasick automaton. It also provides access to lower level APIs that permit walking the state transitions of an Aho-Corasick automaton manually.

ModulesΒ§

private πŸ”’
We seal the Automaton trait for now. It’s a big trait, and it’s conceivable that I might want to add new required methods, and sealing the trait permits doing that in a backwards compatible fashion. On other the hand, if you have a solid use case for implementing the trait yourself, please file an issue and we can discuss it. This was mostly done as a conservative step.

StructsΒ§

FindIter
An iterator of non-overlapping matches in a particular haystack.
FindOverlappingIter
An iterator of overlapping matches in a particular haystack.
OverlappingState
Represents the current state of an overlapping search.
Prefilter
A prefilter for accelerating a search.
StateID
The identifier of a finite automaton state.
StateIDError
This error occurs when an ID could not be constructed.
StreamChunkIter πŸ”’
An iterator that reports matches in a stream.
StreamFindIter
An iterator that reports matches in a stream.

EnumsΒ§

Candidate
A candidate is the result of running a prefilter on a haystack at a particular position.
StreamChunk πŸ”’
A single chunk yielded by the stream chunk iterator.

TraitsΒ§

Automaton
A trait that abstracts over Aho-Corasick automata.

FunctionsΒ§

fmt_state_indicator πŸ”’
Write a prefix β€œstate” indicator for fmt::Debug impls. It always writes exactly two printable bytes to the given formatter.
get_match πŸ”’
sparse_transitions πŸ”’
Return an iterator of transitions in a sparse format given an iterator of all explicitly defined transitions. The iterator yields ranges of transitions, such that any adjacent transitions mapped to the same state are combined into a single range.
try_find_fwd πŸ”’
try_find_fwd_imp πŸ”’
try_find_overlapping_fwd πŸ”’
try_find_overlapping_fwd_imp πŸ”’