kvarn_utils::prelude::str::pattern

Trait Pattern

source
pub trait Pattern: Sized {
    type Searcher<'a>: Searcher<'a>;

    // Required methods
    fn into_searcher(self, haystack: &str) -> Self::Searcher<'_>;
    fn as_utf8_pattern(&self) -> Option<Utf8Pattern<'_>>;

    // Provided methods
    fn is_contained_in(self, haystack: &str) -> bool { ... }
    fn is_prefix_of(self, haystack: &str) -> bool { ... }
    fn is_suffix_of<'a>(self, haystack: &'a str) -> bool
       where Self::Searcher<'a>: ReverseSearcher<'a> { ... }
    fn strip_prefix_of(self, haystack: &str) -> Option<&str> { ... }
    fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str>
       where Self::Searcher<'a>: ReverseSearcher<'a> { ... }
}
🔬This is a nightly-only experimental API. (pattern)<