Trait Matcherpub

Source
:trait(pub) Matcher haystack elem
  .find-in ( Self haystack  (Option (Range AnyInt)) )
  .find-all-in ( Self haystack  (Vec (Range AnyInt)) )
Description

Search-pattern interface. Self is the matcher (e.g. a literal needle, a codepoint, a character class). haystack is the input sequence type. elem is the element type of the haystack.

.find-in returns the byte/index range of the first match. .find-all-in returns the non-overlapping match ranges in order.

Required Methods

.find-in ( Self haystack (Option (Range AnyInt)) )

Byte/index range of the first match, or None if the matcher finds no occurrence in the input.

.find-all-in ( Self haystack (Vec (Range AnyInt)) )

All non-overlapping match ranges in input order.

Implementors

impl Matcher for Codepoint

impl Matcher for Str

impl Matcher for Vec