Struct aho_corasick::FullAcAutomaton
source · pub struct FullAcAutomaton<P> { /* private fields */ }
Expand description
A complete Aho-Corasick automaton.
This uses a single transition matrix that permits each input character to move to the next state with a single lookup in the matrix.
This is as fast as it gets, but it is guaranteed to use a lot of memory.
Namely, it will use at least 4 * 256 * #states
, where the number of
states is capped at length of all patterns concatenated.
Implementations§
source§impl<P: AsRef<[u8]>> FullAcAutomaton<P>
impl<P: AsRef<[u8]>> FullAcAutomaton<P>
sourcepub fn new<T: Transitions>(ac: AcAutomaton<P, T>) -> FullAcAutomaton<P>
pub fn new<T: Transitions>(ac: AcAutomaton<P, T>) -> FullAcAutomaton<P>
Build a new expanded Aho-Corasick automaton from an existing Aho-Corasick automaton.
Trait Implementations§
source§impl<P: AsRef<[u8]>> Automaton<P> for FullAcAutomaton<P>
impl<P: AsRef<[u8]>> Automaton<P> for FullAcAutomaton<P>
source§fn next_state(&self, si: StateIdx, i: u8) -> StateIdx
fn next_state(&self, si: StateIdx, i: u8) -> StateIdx
Return the next state given the current state and next character.
source§fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match
fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match
Build a match given the current state, pattern index and input index.
source§fn has_match(&self, si: StateIdx, outi: usize) -> bool
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. Read more
source§fn start_bytes(&self) -> &[u8] ⓘ
fn start_bytes(&self) -> &[u8] ⓘ
Return the set of bytes that have transitions in the root state.
source§fn find<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> ⓘwhere
Self: Sized,
fn find<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> Matches<'a, 's, P, Self> ⓘwhere
Self: Sized,
Returns an iterator of non-overlapping matches in
s
.source§fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> ⓘwhere
Self: Sized,
fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
&'a self,
s: &'s Q
) -> MatchesOverlapping<'a, 's, P, Self> ⓘwhere
Self: Sized,
Returns an iterator of overlapping matches in
s
.source§fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self> ⓘwhere
Self: Sized,
fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, P, Self> ⓘwhere
Self: Sized,
Returns an iterator of non-overlapping matches in the given reader.
source§fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> ⓘwhere
Self: Sized,
fn stream_find_overlapping<'a, R: Read>(
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> ⓘwhere
Self: Sized,
Returns an iterator of overlapping matches in the given reader.
source§impl<P: Clone> Clone for FullAcAutomaton<P>
impl<P: Clone> Clone for FullAcAutomaton<P>
source§fn clone(&self) -> FullAcAutomaton<P>
fn clone(&self) -> FullAcAutomaton<P>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more