Struct aho_corasick::AcAutomaton
[−]
[src]
pub struct AcAutomaton { // some fields omitted }
An Aho-Corasick finite automaton.
Methods
impl AcAutomaton
[src]
fn new<S, I>(pats: I) -> AcAutomaton where S: Into<String>, I: IntoIterator<Item=S>
Create a new automaton from an iterator of patterns.
The patterns must be convertible to Unicode String
values via the
Into
trait.
fn find<'a, 's>(&'a self, s: &'s str) -> Matches<'a, 's>
Returns an iterator of non-overlapping matches in s
.
fn find_overlapping<'a, 's>(&'a self, s: &'s str) -> MatchesOverlapping<'a, 's>
Returns an iterator of overlapping matches in s
.
fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R>
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>
Returns an iterator of overlapping matches in the given reader.
fn pattern(&self, i: usize) -> &str
Returns the pattern indexed at i
.
The index corresponds to the position at which the pattern was added
to the automaton, starting at 0
.
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.
Trait Implementations
impl Clone for AcAutomaton
[src]
fn clone(&self) -> AcAutomaton
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<S: Into<String>> FromIterator<S> for AcAutomaton
[src]
fn from_iter<T>(it: T) -> AcAutomaton where T: IntoIterator<Item=S>
Create an automaton from an iterator of strings.