Trait aho_corasick::Automaton[][src]

pub trait Automaton<P> {
    fn next_state(&self, si: StateIdx, b: u8) -> StateIdx;
fn has_match(&self, si: StateIdx, outi: usize) -> bool;
fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match;
fn start_bytes(&self) -> &[u8];
fn patterns(&self) -> &[P];
fn pattern(&self, i: usize) -> &P; fn len(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
fn find<'a, 's, Q: ?Sized + AsRef<[u8]>>(
        &'a self,
        s: &'s Q
    ) -> Matches<'a, 's, P, Self>
Notable traits for Matches<'a, 's, P, A>
impl<'a, 's, P, A: Automaton<P> + ?Sized> Iterator for Matches<'a, 's, P, A> type Item = Match;

    where
        Self: Sized
, { ... }
fn find_overlapping<'a, 's, Q: ?Sized + AsRef<[u8]>>(
        &'a self,
        s: &'s Q
    ) -> MatchesOverlapping<'a, 's, P, Self>
Notable traits for MatchesOverlapping<'a, 's, P, A>
impl<'a, 's, P, A: Automaton<P> + ?Sized> Iterator for MatchesOverlapping<'a, 's, P, A> type Item = Match;

    where
        Self: Sized
, { ... }
fn stream_find<'a, R: Read>(
        &'a self,
        rdr: R
    ) -> StreamMatches<'a, R, P, Self>
Notable traits for StreamMatches<'a, R, P, A>
impl<'a, R: Read, P, A: Automaton<P>> Iterator for StreamMatches<'a, R, P, A> type Item = Result<Match>;

    where
        Self: Sized
, { ... }
fn stream_find_overlapping<'a, R: Read>(
        &'a self,
        rdr: R
    ) -> StreamMatchesOverlapping<'a, R, P, Self>
Notable traits for StreamMatchesOverlapping<'a, R, P, A>
impl<'a, R: Read, P, A: Automaton<P> + ?Sized> Iterator for StreamMatchesOverlapping<'a, R, P, A> type Item = Result<Match>;

    where
        Self: Sized
, { ... } }
Expand description

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

Return the next state given the current state and next character.

Return true if and only if the given state and current pattern index indicate a match.

Build a match given the current state, pattern index and input index.

Return the set of bytes that have transitions in the root state.

Returns all of the patterns matched by this automaton.

The order of the patterns is the order in which they were added.

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

Return the number of patterns in the automaton.

Returns true if the automaton has no patterns.

Returns an iterator of non-overlapping matches in s.

Returns an iterator of overlapping matches in s.

Returns an iterator of non-overlapping matches in the given reader.

Returns an iterator of overlapping matches in the given reader.

Implementations on Foreign Types

Implementors