[−][src]Struct aho_corasick::AcAutomaton
An Aho-Corasick finite automaton.
The type parameter P
is the type of the pattern that was used to
construct this AcAutomaton.
Methods
impl<P: AsRef<[u8]>> AcAutomaton<P>
[src]
pub fn new<I>(pats: I) -> AcAutomaton<P, Dense> where
I: IntoIterator<Item = P>,
[src]
I: IntoIterator<Item = P>,
Create a new automaton from an iterator of patterns.
The patterns must be convertible to bytes (&[u8]
) via the AsRef
trait.
impl<P: AsRef<[u8]>, T: Transitions> AcAutomaton<P, T>
[src]
pub fn with_transitions<I>(pats: I) -> AcAutomaton<P, T> where
I: IntoIterator<Item = P>,
[src]
I: IntoIterator<Item = P>,
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.
pub fn into_full(self) -> FullAcAutomaton<P>
[src]
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
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]
Return the number of patterns in the automaton.
fn is_empty(&self) -> bool
[src]
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,
[src]
&'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,
[src]
&'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,
[src]
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,
[src]
&'a self,
rdr: R
) -> StreamMatchesOverlapping<'a, R, P, Self> where
Self: Sized,
Returns an iterator of overlapping matches in the given reader.
impl<P: Clone, T: Clone> Clone for AcAutomaton<P, T>
[src]
fn clone(&self) -> AcAutomaton<P, T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<P: AsRef<[u8]> + Debug, T: Transitions> Debug for AcAutomaton<P, T>
[src]
impl<S: AsRef<[u8]>> FromIterator<S> for AcAutomaton<S>
[src]
fn from_iter<T>(it: T) -> AcAutomaton<S> where
T: IntoIterator<Item = S>,
[src]
T: IntoIterator<Item = S>,
Create an automaton from an iterator of strings.
Auto Trait Implementations
impl<P, T> Send for AcAutomaton<P, T> where
P: Send,
T: Send,
P: Send,
T: Send,
impl<P, T> Sync for AcAutomaton<P, T> where
P: Sync,
T: Sync,
P: Sync,
T: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,