Struct aho_corasick::AcAutomaton [−][src]
pub struct AcAutomaton<P, T = Dense> { /* fields omitted */ }
Expand description
An Aho-Corasick finite automaton.
The type parameter P
is the type of the pattern that was used to
construct this AcAutomaton.
Implementations
Create a new automaton from an iterator of patterns.
The patterns must be convertible to bytes (&[u8]
) via the AsRef
trait.
Create a new automaton from an iterator of patterns.
This constructor allows one to choose the transition representation.
The patterns must be convertible to bytes (&[u8]
) via the AsRef
trait.
Build out the entire automaton into a single matrix.
This will make searching as fast as possible at the expense of using
at least 4 * 256 * #states
bytes of memory.
Trait Implementations
Return the next state given the current state and next character.
Build a match given the current state, pattern index and input index.
Return true if and only if the given state and current pattern index indicate a match. Read more
Return the set of bytes that have transitions in the root state.
Returns an iterator of non-overlapping matches in s
.
fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self>ⓘNotable traits for MatchesOverlapping<'a, 's, P, A>impl<'a, 's, P, A: Automaton<P> + ?Sized> Iterator for MatchesOverlapping<'a, 's, P, A> type Item = Match;
where
Self: Sized,
fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self>ⓘNotable traits for MatchesOverlapping<'a, 's, P, A>impl<'a, 's, P, A: Automaton<P> + ?Sized> Iterator for MatchesOverlapping<'a, 's, P, A> type Item = Match;
where
Self: Sized,
impl<'a, 's, P, A: Automaton<P> + ?Sized> Iterator for MatchesOverlapping<'a, 's, P, A> type Item = Match;
Returns an iterator of overlapping matches in s
.
fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self>ⓘNotable traits for StreamMatches<'a, R, P, A>impl<'a, R: Read, P, A: Automaton<P>> Iterator for StreamMatches<'a, R, P, A> type Item = Result<Match>;
where
Self: Sized,
fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self>ⓘNotable traits for StreamMatches<'a, R, P, A>impl<'a, R: Read, P, A: Automaton<P>> Iterator for StreamMatches<'a, R, P, A> type Item = Result<Match>;
where
Self: Sized,
impl<'a, R: Read, P, A: Automaton<P>> Iterator for StreamMatches<'a, R, P, A> type Item = Result<Match>;
Returns an iterator of non-overlapping matches in the given reader.
fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self>ⓘNotable traits for StreamMatchesOverlapping<'a, R, P, A>impl<'a, R: Read, P, A: Automaton<P> + ?Sized> Iterator for StreamMatchesOverlapping<'a, R, P, A> type Item = Result<Match>;
where
Self: Sized,
fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self>ⓘNotable traits for StreamMatchesOverlapping<'a, R, P, A>impl<'a, R: Read, P, A: Automaton<P> + ?Sized> Iterator for StreamMatchesOverlapping<'a, R, P, A> type Item = Result<Match>;
where
Self: Sized,
impl<'a, R: Read, P, A: Automaton<P> + ?Sized> Iterator for StreamMatchesOverlapping<'a, R, P, A> type Item = Result<Match>;
Returns an iterator of overlapping matches in the given reader.
Create an automaton from an iterator of strings.
Auto Trait Implementations
impl<P, T> RefUnwindSafe for AcAutomaton<P, T> where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<P, T> Send for AcAutomaton<P, T> where
P: Send,
T: Send,
impl<P, T> Sync for AcAutomaton<P, T> where
P: Sync,
T: Sync,
impl<P, T> Unpin for AcAutomaton<P, T> where
P: Unpin,
T: Unpin,
impl<P, T> UnwindSafe for AcAutomaton<P, T> where
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more