str::[−][src] pattern:: Searcher
A searcher for a string pattern.
This trait provides methods for searching for non-overlapping matches of a pattern starting from the front (left) of a string.
It will be implemented by associated
types of the
The trait is marked unsafe because the indices returned by the
next() methods are required to lie on valid utf8
boundaries in the haystack. This enables consumers of this trait to
slice the haystack without additional runtime checks.
Getter for the underlying string to be searched in
Will always return the same
Performs the next search step starting from the front.
haystack[a..b]matches the pattern.
haystack[a..b]can not match the pattern, even partially.
Doneif every byte of the haystack has been visited.
As an example, the pattern
"aaa" and the haystack
might produce the stream
[Reject(0, 1), Reject(1, 2), Match(2, 5), Reject(5, 8)]