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§
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
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>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".