Struct galil_seiferas::Pattern
[−]
[src]
pub struct Pattern<'a, T: 'a, F = ()> { /* fields omitted */ }
A preprocessed pattern.
Methods
impl<'a, T: Eq> Pattern<'a, T>
[src]
fn preprocess(pattern: &'a [T]) -> Self
[src]
Preprocess the string pattern
so that it can be used with the
Galil-Seiferas algorithm.
fn find_in(&self, text: &[T]) -> Option<usize>
[src]
If a match exists where the pattern is a substring of text
, return the
offset to the start of the match inside Some(_)
. If not, return
None
.
impl<'a, T, F> Pattern<'a, T, F> where
F: Fn(&T, &T) -> bool,
[src]
F: Fn(&T, &T) -> bool,
fn preprocess_using(pattern: &'a [T], equal: F) -> Self
[src]
Preprocess the string pattern
so that it can be used with the
Galil-Seiferas algorithm.
Use equal
as the equality comparison function.
fn find_in(&self, text: &[T]) -> Option<usize>
[src]
If a match exists where the pattern is a substring of text
, return the
offset to the start of the match inside Some(_)
. If not, return
None
.