Skip to main content

Pattern

Trait Pattern 

Source
pub trait Pattern {
    type SplitIter<'a>: Iterator<Item = &'a str>
       where Self: 'a;
    type MatchesIter<'a>: Iterator<Item = &'a str>
       where Self: 'a;
    type RMatchesIter<'a>: Iterator<Item = &'a str>
       where Self: 'a;
    type MatchIndicesIter<'a>: Iterator<Item = (usize, &'a str)>
       where Self: 'a;
    type RMatchIndicesIter<'a>: Iterator<Item = (usize, &'a str)>
       where Self: 'a;

Show 14 methods // Required methods fn split<'a>(self, s: &'a str) -> Self::SplitIter<'a> where Self: 'a; fn split_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>; fn rsplit_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>; fn strip_prefix<'a>(&self, s: &'a str) -> Option<&'a str>; fn strip_suffix<'a>(&self, s: &'a str) -> Option<&'a str>; fn matches<'a>(self, s: &'a str) -> Self::MatchesIter<'a> where Self: 'a; fn rmatches<'a>(self, s: &'a str) -> Self::RMatchesIter<'a> where Self: 'a; fn match_indices<'a>(self, s: &'a str) -> Self::MatchIndicesIter<'a> where Self: 'a; fn rmatch_indices<'a>(self, s: &'a str) -> Self::RMatchIndicesIter<'a> where Self: 'a; fn contains(&self, s: &str) -> bool; fn starts_with(&self, s: &str) -> bool; fn ends_with(&self, s: &str) -> bool; fn find(&self, s: &str) -> Option<usize>; fn rfind(&self, s: &str) -> Option<usize>;
}

Required Associated Types§

Source

type SplitIter<'a>: Iterator<Item = &'a str> where Self: 'a

Source

type MatchesIter<'a>: Iterator<Item = &'a str> where Self: 'a

Source

type RMatchesIter<'a>: Iterator<Item = &'a str> where Self: 'a

Source

type MatchIndicesIter<'a>: Iterator<Item = (usize, &'a str)> where Self: 'a

Source

type RMatchIndicesIter<'a>: Iterator<Item = (usize, &'a str)> where Self: 'a

Required Methods§

Source

fn split<'a>(self, s: &'a str) -> Self::SplitIter<'a>
where Self: 'a,

Source

fn split_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>

Source

fn rsplit_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>

Source

fn strip_prefix<'a>(&self, s: &'a str) -> Option<&'a str>

Source

fn strip_suffix<'a>(&self, s: &'a str) -> Option<&'a str>

Source

fn matches<'a>(self, s: &'a str) -> Self::MatchesIter<'a>
where Self: 'a,

Source

fn rmatches<'a>(self, s: &'a str) -> Self::RMatchesIter<'a>
where Self: 'a,

Source

fn match_indices<'a>(self, s: &'a str) -> Self::MatchIndicesIter<'a>
where Self: 'a,

Source

fn rmatch_indices<'a>(self, s: &'a str) -> Self::RMatchIndicesIter<'a>
where Self: 'a,

Source

fn contains(&self, s: &str) -> bool

Source

fn starts_with(&self, s: &str) -> bool

Source

fn ends_with(&self, s: &str) -> bool

Source

fn find(&self, s: &str) -> Option<usize>

Source

fn rfind(&self, s: &str) -> Option<usize>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Pattern for char

Source§

type SplitIter<'a> = Split<'a, char>

Source§

type MatchesIter<'a> = Matches<'a, char>

Source§

type RMatchesIter<'a> = RMatches<'a, char>

Source§

type MatchIndicesIter<'a> = MatchIndices<'a, char>

Source§

type RMatchIndicesIter<'a> = RMatchIndices<'a, char>

Source§

fn split<'a>(self, s: &'a str) -> Self::SplitIter<'a>
where Self: 'a,

Source§

fn split_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>

Source§

fn rsplit_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>

Source§

fn strip_prefix<'a>(&self, s: &'a str) -> Option<&'a str>

Source§

fn strip_suffix<'a>(&self, s: &'a str) -> Option<&'a str>

Source§

fn matches<'a>(self, s: &'a str) -> Self::MatchesIter<'a>
where Self: 'a,

Source§

fn rmatches<'a>(self, s: &'a str) -> Self::RMatchesIter<'a>
where Self: 'a,

Source§

fn match_indices<'a>(self, s: &'a str) -> Self::MatchIndicesIter<'a>
where Self: 'a,

Source§

fn rmatch_indices<'a>(self, s: &'a str) -> Self::RMatchIndicesIter<'a>
where Self: 'a,

Source§

fn contains(&self, s: &str) -> bool

Source§

fn starts_with(&self, s: &str) -> bool

Source§

fn ends_with(&self, s: &str) -> bool

Source§

fn find(&self, s: &str) -> Option<usize>

Source§

fn rfind(&self, s: &str) -> Option<usize>

Source§

impl<'p> Pattern for &'p str

Source§

type SplitIter<'a> = Split<'a, &'p str> where Self: 'a

Source§

type MatchesIter<'a> = Matches<'a, &'p str> where Self: 'a

Source§

type RMatchesIter<'a> = RMatches<'a, &'p str> where Self: 'a

Source§

type MatchIndicesIter<'a> = MatchIndices<'a, &'p str> where Self: 'a

Source§

type RMatchIndicesIter<'a> = RMatchIndices<'a, &'p str> where Self: 'a

Source§

fn split<'a>(self, s: &'a str) -> Self::SplitIter<'a>
where Self: 'a,

Source§

fn matches<'a>(self, s: &'a str) -> Self::MatchesIter<'a>
where Self: 'a,

Source§

fn rmatches<'a>(self, s: &'a str) -> Self::RMatchesIter<'a>
where Self: 'a,

Source§

fn match_indices<'a>(self, s: &'a str) -> Self::MatchIndicesIter<'a>
where Self: 'a,

Source§

fn rmatch_indices<'a>(self, s: &'a str) -> Self::RMatchIndicesIter<'a>
where Self: 'a,

Source§

fn split_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>

Source§

fn rsplit_once<'a>(&self, s: &'a str) -> Option<(&'a str, &'a str)>

Source§

fn strip_prefix<'a>(&self, s: &'a str) -> Option<&'a str>

Source§

fn strip_suffix<'a>(&self, s: &'a str) -> Option<&'a str>

Source§

fn contains(&self, s: &str) -> bool

Source§

fn starts_with(&self, s: &str) -> bool

Source§

fn ends_with(&self, s: &str) -> bool

Source§

fn find(&self, s: &str) -> Option<usize>

Source§

fn rfind(&self, s: &str) -> Option<usize>

Implementors§