Struct aho_corasick::AcAutomaton
[−]
[src]
pub struct AcAutomaton<T = Dense> { // some fields omitted }
An Aho-Corasick finite automaton.
Methods
impl AcAutomaton
[src]
fn new<S, I>(pats: I) -> AcAutomaton<Dense> 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.
impl<T: Transitions> AcAutomaton<T>
[src]
fn with_transitions<S, I>(pats: I) -> AcAutomaton<T> where S: Into<String>, I: IntoIterator<Item=S>
Create a new automaton from an iterator of patterns.
This constructor allows one to choose the transition representation.
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, T>
Returns an iterator of non-overlapping matches in s
.
fn find_overlapping<'a, 's>(&'a self, s: &'s str) -> MatchesOverlapping<'a, 's, T>
Returns an iterator of overlapping matches in s
.
fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, T>
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, T>
Returns an iterator of overlapping matches in the given reader.
fn patterns(&self) -> &[String]
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) -> &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<T: Clone> Clone for AcAutomaton<T>
[src]
fn clone(&self) -> AcAutomaton<T>
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.