[−][src]Trait aho_corasick::Automaton
An abstraction over automatons and their corresponding iterators.
The type parameter P
is the type of the pattern that was used to
construct this Automaton.
Required methods
fn next_state(&self, si: StateIdx, b: u8) -> StateIdx
Return the next state given the current state and next character.
fn has_match(&self, si: StateIdx, outi: usize) -> bool
Return true if and only if the given state and current pattern index indicate a match.
fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match
Build a match given the current state, pattern index and input index.
fn start_bytes(&self) -> &[u8]
Return the set of bytes that have transitions in the root state.
fn patterns(&self) -> &[P]
Returns all of the patterns matched by this automaton.
The order of the patterns is the order in which they were added.
fn pattern(&self, i: usize) -> &P
Returns the pattern indexed at i
.
The index corresponds to the position at which the pattern was added
to the automaton, starting at 0
.
Provided methods
fn len(&self) -> usize
Return the number of patterns in the automaton.
fn is_empty(&self) -> bool
Returns true if the automaton has no patterns.
ⓘImportant traits for Matches<'a, 's, P, A>fn find<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
Returns an iterator of non-overlapping matches in s
.
ⓘImportant traits for MatchesOverlapping<'a, 's, P, A>fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
Returns an iterator of overlapping matches in s
.
ⓘImportant traits for StreamMatches<'a, R, P, A>fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self> where
Self: Sized,
Self: Sized,
Returns an iterator of non-overlapping matches in the given reader.
ⓘImportant traits for StreamMatchesOverlapping<'a, R, P, A>fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
Returns an iterator of overlapping matches in the given reader.
Implementations on Foreign Types
impl<'a, P: AsRef<[u8]>, A: 'a + Automaton<P> + ?Sized> Automaton<P> for &'a A
[src]
fn next_state(&self, si: StateIdx, b: u8) -> StateIdx
[src]
fn has_match(&self, si: StateIdx, outi: usize) -> bool
[src]
fn start_bytes(&self) -> &[u8]
[src]
fn patterns(&self) -> &[P]
[src]
fn pattern(&self, i: usize) -> &P
[src]
fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
ⓘImportant traits for Matches<'a, 's, P, A>fn find<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
[src]
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
ⓘImportant traits for MatchesOverlapping<'a, 's, P, A>fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
[src]
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
ⓘImportant traits for StreamMatches<'a, R, P, A>fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self> where
Self: Sized,
[src]
Self: Sized,
ⓘImportant traits for StreamMatchesOverlapping<'a, R, P, A>fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
[src]
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
Implementors
impl<P: AsRef<[u8]>> Automaton<P> for FullAcAutomaton<P>
[src]
fn next_state(&self, si: StateIdx, i: u8) -> StateIdx
[src]
fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match
[src]
fn has_match(&self, si: StateIdx, outi: usize) -> bool
[src]
fn start_bytes(&self) -> &[u8]
[src]
fn patterns(&self) -> &[P]
[src]
fn pattern(&self, i: usize) -> &P
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
ⓘImportant traits for Matches<'a, 's, P, A>fn find<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
[src]
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
ⓘImportant traits for MatchesOverlapping<'a, 's, P, A>fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
[src]
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
ⓘImportant traits for StreamMatches<'a, R, P, A>fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self> where
Self: Sized,
[src]
Self: Sized,
ⓘImportant traits for StreamMatchesOverlapping<'a, R, P, A>fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
[src]
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
impl<P: AsRef<[u8]>, T: Transitions> Automaton<P> for AcAutomaton<P, T>
[src]
fn next_state(&self, si: StateIdx, b: u8) -> StateIdx
[src]
fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match
[src]
fn has_match(&self, si: StateIdx, outi: usize) -> bool
[src]
fn start_bytes(&self) -> &[u8]
[src]
fn patterns(&self) -> &[P]
[src]
fn pattern(&self, i: usize) -> &P
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
ⓘImportant traits for Matches<'a, 's, P, A>fn find<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
[src]
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> where
Self: Sized,
ⓘImportant traits for MatchesOverlapping<'a, 's, P, A>fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
[src]
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> where
Self: Sized,
ⓘImportant traits for StreamMatches<'a, R, P, A>fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self> where
Self: Sized,
[src]
Self: Sized,
ⓘImportant traits for StreamMatchesOverlapping<'a, R, P, A>fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
[src]
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,