[−][src]Struct aho_corasick::packed::Config
The configuration for a packed multiple pattern searcher.
The configuration is currently limited only to being able to select the match semantics (leftmost-first or leftmost-longest) of a searcher. In the future, more knobs may be made available.
A configuration produces a packed::Builder
, which
in turn can be used to construct a
packed::Searcher
for searching.
Example
This example shows how to use leftmost-longest semantics instead of the default (leftmost-first).
use aho_corasick::packed::{Config, MatchKind}; let searcher = Config::new() .match_kind(MatchKind::LeftmostLongest) .builder() .add("foo") .add("foobar") .build()?; let matches: Vec<usize> = searcher .find_iter("foobar") .map(|mat| mat.pattern()) .collect(); assert_eq!(vec![1], matches);
Implementations
impl Config
[src]
pub fn new() -> Config
[src]
Create a new default configuration. A default configuration uses leftmost-first match semantics.
pub fn builder(&self) -> Builder
[src]
Create a packed builder from this configuration. The builder can be
used to accumulate patterns and create a
Searcher
from them.
pub fn match_kind(&mut self, kind: MatchKind) -> &mut Config
[src]
Set the match semantics for this configuration.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,