Module aho_corasick::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§
- An iterator of non-overlapping matches in a particular haystack.
- An iterator of overlapping matches in a particular haystack.
- Represents the current state of an overlapping search.
- A prefilter for accelerating a search.
- The identifier of a finite automaton state.
- This error occurs when an ID could not be constructed.
- Stream
Chunk πIter An iterator that reports matches in a stream. - An iterator that reports matches in a stream.
Enums§
- A candidate is the result of running a prefilter on a haystack at a particular position.
- Stream
Chunk πA single chunk yielded by the stream chunk iterator.
Traits§
- 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