pub trait Searchable: Sealed {
type Split<'a>: Iterator<Item = &'a str>;
type RSplit<'a>: Iterator<Item = &'a str>;
type SplitTerminator<'a>: Iterator<Item = &'a str>;
type RSplitTerminator<'a>: Iterator<Item = &'a str>;
type SplitN<'a>: Iterator<Item = &'a str>;
type RSplitN<'a>: Iterator<Item = &'a str>;
type Matches<'a>: Iterator<Item = &'a str>;
type RMatches<'a>: Iterator<Item = &'a str>;
type MatchIndices<'a>: Iterator<Item = (usize, &'a str)>;
type RMatchIndices<'a>: Iterator<Item = (usize, &'a str)>;
type SplitInclusive<'a>: Iterator<Item = &'a str>;
Show 24 methods
// Required methods
fn contains_impl(self, haystack: &str) -> bool;
fn starts_with_impl(self, haystack: &str) -> bool;
fn ends_with_impl(self, haystack: &str) -> bool;
fn find_impl(self, haystack: &str) -> Option<usize>;
fn rfind_impl(self, haystack: &str) -> Option<usize>;
fn split_impl(self, haystack: &str) -> Self::Split<'_>;
fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>;
fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>;
fn rsplit_terminator_impl(
self,
haystack: &str,
) -> Self::RSplitTerminator<'_>;
fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>;
fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>;
fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>;
fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>;
fn matches_impl(self, haystack: &str) -> Self::Matches<'_>;
fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>;
fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>;
fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>;
fn trim_start_matches_impl(self, haystack: &str) -> &str;
fn strip_prefix_impl(self, haystack: &str) -> Option<&str>;
fn strip_suffix_impl(self, haystack: &str) -> Option<&str>;
fn replace_impl(self, haystack: &str, to: &str) -> String;
fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String;
fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>;
fn trim_end_matches_impl(self, haystack: &str) -> &str;
}Required Associated Types§
type Split<'a>: Iterator<Item = &'a str>
type RSplit<'a>: Iterator<Item = &'a str>
type SplitTerminator<'a>: Iterator<Item = &'a str>
type RSplitTerminator<'a>: Iterator<Item = &'a str>
type SplitN<'a>: Iterator<Item = &'a str>
type RSplitN<'a>: Iterator<Item = &'a str>
type Matches<'a>: Iterator<Item = &'a str>
type RMatches<'a>: Iterator<Item = &'a str>
type MatchIndices<'a>: Iterator<Item = (usize, &'a str)>
type RMatchIndices<'a>: Iterator<Item = (usize, &'a str)>
type SplitInclusive<'a>: Iterator<Item = &'a str>
Required Methods§
fn contains_impl(self, haystack: &str) -> bool
fn starts_with_impl(self, haystack: &str) -> bool
fn ends_with_impl(self, haystack: &str) -> bool
fn find_impl(self, haystack: &str) -> Option<usize>
fn rfind_impl(self, haystack: &str) -> Option<usize>
fn split_impl(self, haystack: &str) -> Self::Split<'_>
fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>
fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>
fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>
fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>
fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>
fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn matches_impl(self, haystack: &str) -> Self::Matches<'_>
fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>
fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>
fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>
fn trim_start_matches_impl(self, haystack: &str) -> &str
fn strip_prefix_impl(self, haystack: &str) -> Option<&str>
fn strip_suffix_impl(self, haystack: &str) -> Option<&str>
fn replace_impl(self, haystack: &str, to: &str) -> String
fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String
fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>
fn trim_end_matches_impl(self, haystack: &str) -> &str
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Searchable for &str
Available on crate feature 1.0 only.
impl Searchable for &str
Available on crate feature
1.0 only.type Split<'a> = Split<'a, &str>
type RSplit<'a> = RSplit<'a, &str>
type SplitTerminator<'a> = SplitTerminator<'a, &str>
type RSplitTerminator<'a> = RSplitTerminator<'a, &str>
type SplitN<'a> = SplitN<'a, &str>
type RSplitN<'a> = RSplitN<'a, &str>
type Matches<'a> = Matches<'a, &str>
type RMatches<'a> = RMatches<'a, &str>
type MatchIndices<'a> = MatchIndices<'a, &str>
type RMatchIndices<'a> = RMatchIndices<'a, &str>
type SplitInclusive<'a> = SplitInclusive<'a, &str>
fn contains_impl(self, haystack: &str) -> bool
fn starts_with_impl(self, haystack: &str) -> bool
fn ends_with_impl(self, haystack: &str) -> bool
fn find_impl(self, haystack: &str) -> Option<usize>
fn rfind_impl(self, haystack: &str) -> Option<usize>
fn split_impl(self, haystack: &str) -> Self::Split<'_>
fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>
fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>
fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>
fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>
fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>
fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn matches_impl(self, haystack: &str) -> Self::Matches<'_>
fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>
fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>
fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>
fn trim_start_matches_impl(self, haystack: &str) -> &str
fn strip_prefix_impl(self, haystack: &str) -> Option<&str>
fn strip_suffix_impl(self, haystack: &str) -> Option<&str>
fn replace_impl(self, haystack: &str, to: &str) -> String
fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String
fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>
fn trim_end_matches_impl(self, haystack: &str) -> &str
Source§impl Searchable for &[char]
Available on crate feature 1.0 only.
impl Searchable for &[char]
Available on crate feature
1.0 only.type Split<'a> = Split<'a, &[char]>
type RSplit<'a> = RSplit<'a, &[char]>
type SplitTerminator<'a> = SplitTerminator<'a, &[char]>
type RSplitTerminator<'a> = RSplitTerminator<'a, &[char]>
type SplitN<'a> = SplitN<'a, &[char]>
type RSplitN<'a> = RSplitN<'a, &[char]>
type Matches<'a> = Matches<'a, &[char]>
type RMatches<'a> = RMatches<'a, &[char]>
type MatchIndices<'a> = MatchIndices<'a, &[char]>
type RMatchIndices<'a> = RMatchIndices<'a, &[char]>
type SplitInclusive<'a> = SplitInclusive<'a, &[char]>
fn contains_impl(self, haystack: &str) -> bool
fn starts_with_impl(self, haystack: &str) -> bool
fn ends_with_impl(self, haystack: &str) -> bool
fn find_impl(self, haystack: &str) -> Option<usize>
fn rfind_impl(self, haystack: &str) -> Option<usize>
fn split_impl(self, haystack: &str) -> Self::Split<'_>
fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>
fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>
fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>
fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>
fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>
fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn matches_impl(self, haystack: &str) -> Self::Matches<'_>
fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>
fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>
fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>
fn trim_start_matches_impl(self, haystack: &str) -> &str
fn strip_prefix_impl(self, haystack: &str) -> Option<&str>
fn strip_suffix_impl(self, haystack: &str) -> Option<&str>
fn replace_impl(self, haystack: &str, to: &str) -> String
fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String
fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>
fn trim_end_matches_impl(self, haystack: &str) -> &str
Source§impl Searchable for char
Available on crate feature 1.0 only.
impl Searchable for char
Available on crate feature
1.0 only.type Split<'a> = Split<'a, char>
type RSplit<'a> = RSplit<'a, char>
type SplitTerminator<'a> = SplitTerminator<'a, char>
type RSplitTerminator<'a> = RSplitTerminator<'a, char>
type SplitN<'a> = SplitN<'a, char>
type RSplitN<'a> = RSplitN<'a, char>
type Matches<'a> = Matches<'a, char>
type RMatches<'a> = RMatches<'a, char>
type MatchIndices<'a> = MatchIndices<'a, char>
type RMatchIndices<'a> = RMatchIndices<'a, char>
type SplitInclusive<'a> = SplitInclusive<'a, char>
fn contains_impl(self, haystack: &str) -> bool
fn starts_with_impl(self, haystack: &str) -> bool
fn ends_with_impl(self, haystack: &str) -> bool
fn find_impl(self, haystack: &str) -> Option<usize>
fn rfind_impl(self, haystack: &str) -> Option<usize>
fn split_impl(self, haystack: &str) -> Self::Split<'_>
fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>
fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>
fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>
fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>
fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>
fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn matches_impl(self, haystack: &str) -> Self::Matches<'_>
fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>
fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>
fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>
fn trim_start_matches_impl(self, haystack: &str) -> &str
fn strip_prefix_impl(self, haystack: &str) -> Option<&str>
fn strip_suffix_impl(self, haystack: &str) -> Option<&str>
fn replace_impl(self, haystack: &str, to: &str) -> String
fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String
fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>
fn trim_end_matches_impl(self, haystack: &str) -> &str
Source§impl<const N: usize> Searchable for &[char; N]
Available on crate feature 1.51 only.
impl<const N: usize> Searchable for &[char; N]
Available on crate feature
1.51 only.type Split<'a> = Split<'a, &[char; N]>
type RSplit<'a> = RSplit<'a, &[char; N]>
type SplitTerminator<'a> = SplitTerminator<'a, &[char; N]>
type RSplitTerminator<'a> = RSplitTerminator<'a, &[char; N]>
type SplitN<'a> = SplitN<'a, &[char; N]>
type RSplitN<'a> = RSplitN<'a, &[char; N]>
type Matches<'a> = Matches<'a, &[char; N]>
type RMatches<'a> = RMatches<'a, &[char; N]>
type MatchIndices<'a> = MatchIndices<'a, &[char; N]>
type RMatchIndices<'a> = RMatchIndices<'a, &[char; N]>
type SplitInclusive<'a> = SplitInclusive<'a, &[char; N]>
fn contains_impl(self, haystack: &str) -> bool
fn starts_with_impl(self, haystack: &str) -> bool
fn ends_with_impl(self, haystack: &str) -> bool
fn find_impl(self, haystack: &str) -> Option<usize>
fn rfind_impl(self, haystack: &str) -> Option<usize>
fn split_impl(self, haystack: &str) -> Self::Split<'_>
fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>
fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>
fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>
fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>
fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>
fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn matches_impl(self, haystack: &str) -> Self::Matches<'_>
fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>
fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>
fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>
fn trim_start_matches_impl(self, haystack: &str) -> &str
fn strip_prefix_impl(self, haystack: &str) -> Option<&str>
fn strip_suffix_impl(self, haystack: &str) -> Option<&str>
fn replace_impl(self, haystack: &str, to: &str) -> String
fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String
fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>
fn trim_end_matches_impl(self, haystack: &str) -> &str
Source§impl<const N: usize> Searchable for [char; N]
Available on crate feature 1.51 only.
impl<const N: usize> Searchable for [char; N]
Available on crate feature
1.51 only.type Split<'a> = Split<'a, [char; N]>
type RSplit<'a> = RSplit<'a, [char; N]>
type SplitTerminator<'a> = SplitTerminator<'a, [char; N]>
type RSplitTerminator<'a> = RSplitTerminator<'a, [char; N]>
type SplitN<'a> = SplitN<'a, [char; N]>
type RSplitN<'a> = RSplitN<'a, [char; N]>
type Matches<'a> = Matches<'a, [char; N]>
type RMatches<'a> = RMatches<'a, [char; N]>
type MatchIndices<'a> = MatchIndices<'a, [char; N]>
type RMatchIndices<'a> = RMatchIndices<'a, [char; N]>
type SplitInclusive<'a> = SplitInclusive<'a, [char; N]>
fn contains_impl(self, haystack: &str) -> bool
fn starts_with_impl(self, haystack: &str) -> bool
fn ends_with_impl(self, haystack: &str) -> bool
fn find_impl(self, haystack: &str) -> Option<usize>
fn rfind_impl(self, haystack: &str) -> Option<usize>
fn split_impl(self, haystack: &str) -> Self::Split<'_>
fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>
fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>
fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>
fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>
fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>
fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>
fn matches_impl(self, haystack: &str) -> Self::Matches<'_>
fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>
fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>
fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>
fn trim_start_matches_impl(self, haystack: &str) -> &str
fn strip_prefix_impl(self, haystack: &str) -> Option<&str>
fn strip_suffix_impl(self, haystack: &str) -> Option<&str>
fn replace_impl(self, haystack: &str, to: &str) -> String
fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String
fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>
fn trim_end_matches_impl(self, haystack: &str) -> &str
Implementors§
Source§impl<F> Searchable for F
Available on crate feature 1.0 only.
impl<F> Searchable for F
Available on crate feature
1.0 only.