Struct Builder
pub struct Builder { /* private fields */ }
A builder for configuring an Aho-Corasick DFA.
This builder has a subset of the options available to a
AhoCorasickBuilder. Of the shared options,
their behavior is identical.
Implementations
impl Builder
fn new() -> BuilderCreate a new builder for configuring an Aho-Corasick DFA.
fn build<I, P>(&self, patterns: I) -> Result<DFA, BuildError> where I: IntoIterator<Item = P>, P: AsRef<[u8]>,Build an Aho-Corasick DFA from the given iterator of patterns.
A builder may be reused to create more DFAs.
fn build_from_noncontiguous(&self, nnfa: &NFA) -> Result<DFA, BuildError>Build an Aho-Corasick DFA from the given noncontiguous NFA.
Note that when this method is used, only the
start_kindandbyte_classessettings on this builder are respected. The other settings only apply to the initial construction of the Aho-Corasick automaton. Since using this method requires that initial construction has already completed, all settings impacting only initial construction are no longer relevant.fn match_kind(&mut self, kind: MatchKind) -> &mut BuilderSet the desired match semantics.
This only applies when using
Builder::buildand notBuilder::build_from_noncontiguous.See
AhoCorasickBuilder::match_kindfor more documentation and examples.fn ascii_case_insensitive(&mut self, yes: bool) -> &mut BuilderEnable ASCII-aware case insensitive matching.
This only applies when using
Builder::buildand notBuilder::build_from_noncontiguous.See
AhoCorasickBuilder::ascii_case_insensitivefor more documentation and examples.fn prefilter(&mut self, yes: bool) -> &mut BuilderEnable heuristic prefilter optimizations.
This only applies when using
Builder::buildand notBuilder::build_from_noncontiguous.See
AhoCorasickBuilder::prefilterfor more documentation and examples.fn start_kind(&mut self, kind: StartKind) -> &mut BuilderSets the starting state configuration for the automaton.
See
AhoCorasickBuilder::start_kindfor more documentation and examples.fn byte_classes(&mut self, yes: bool) -> &mut BuilderA debug setting for whether to attempt to shrink the size of the automaton's alphabet or not.
This should never be enabled unless you're debugging an automaton. Namely, disabling byte classes makes transitions easier to reason about, since they use the actual bytes instead of equivalence classes. Disabling this confers no performance benefit at search time.
See
AhoCorasickBuilder::byte_classesfor more documentation and examples.
Trait Implementations
impl Clone for Builder
fn clone(&self) -> Self
impl Debug for Builder
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for Builder
fn default() -> Builder