Searchable

Trait Searchable 

Source
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§

Source

type Split<'a>: Iterator<Item = &'a str>

Source

type RSplit<'a>: Iterator<Item = &'a str>

Source

type SplitTerminator<'a>: Iterator<Item = &'a str>

Source

type RSplitTerminator<'a>: Iterator<Item = &'a str>

Source

type SplitN<'a>: Iterator<Item = &'a str>

Source

type RSplitN<'a>: Iterator<Item = &'a str>

Source

type Matches<'a>: Iterator<Item = &'a str>

Source

type RMatches<'a>: Iterator<Item = &'a str>

Source

type MatchIndices<'a>: Iterator<Item = (usize, &'a str)>

Source

type RMatchIndices<'a>: Iterator<Item = (usize, &'a str)>

Source

type SplitInclusive<'a>: Iterator<Item = &'a str>

Required Methods§

Source

fn contains_impl(self, haystack: &str) -> bool

Source

fn starts_with_impl(self, haystack: &str) -> bool

Source

fn ends_with_impl(self, haystack: &str) -> bool

Source

fn find_impl(self, haystack: &str) -> Option<usize>

Source

fn rfind_impl(self, haystack: &str) -> Option<usize>

Source

fn split_impl(self, haystack: &str) -> Self::Split<'_>

Source

fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>

Source

fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>

Source

fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>

Source

fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>

Source

fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>

Source

fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source

fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source

fn matches_impl(self, haystack: &str) -> Self::Matches<'_>

Source

fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>

Source

fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>

Source

fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>

Source

fn trim_start_matches_impl(self, haystack: &str) -> &str

Source

fn strip_prefix_impl(self, haystack: &str) -> Option<&str>

Source

fn strip_suffix_impl(self, haystack: &str) -> Option<&str>

Source

fn replace_impl(self, haystack: &str, to: &str) -> String

Source

fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String

Source

fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>

Source

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.
Source§

type Split<'a> = Split<'a, &str>

Source§

type RSplit<'a> = RSplit<'a, &str>

Source§

type SplitTerminator<'a> = SplitTerminator<'a, &str>

Source§

type RSplitTerminator<'a> = RSplitTerminator<'a, &str>

Source§

type SplitN<'a> = SplitN<'a, &str>

Source§

type RSplitN<'a> = RSplitN<'a, &str>

Source§

type Matches<'a> = Matches<'a, &str>

Source§

type RMatches<'a> = RMatches<'a, &str>

Source§

type MatchIndices<'a> = MatchIndices<'a, &str>

Source§

type RMatchIndices<'a> = RMatchIndices<'a, &str>

Source§

type SplitInclusive<'a> = SplitInclusive<'a, &str>

Source§

fn contains_impl(self, haystack: &str) -> bool

Source§

fn starts_with_impl(self, haystack: &str) -> bool

Source§

fn ends_with_impl(self, haystack: &str) -> bool

Source§

fn find_impl(self, haystack: &str) -> Option<usize>

Source§

fn rfind_impl(self, haystack: &str) -> Option<usize>

Source§

fn split_impl(self, haystack: &str) -> Self::Split<'_>

Source§

fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>

Source§

fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>

Source§

fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>

Source§

fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>

Source§

fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>

Source§

fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn matches_impl(self, haystack: &str) -> Self::Matches<'_>

Source§

fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>

Source§

fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>

Source§

fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>

Source§

fn trim_start_matches_impl(self, haystack: &str) -> &str

Source§

fn strip_prefix_impl(self, haystack: &str) -> Option<&str>

Source§

fn strip_suffix_impl(self, haystack: &str) -> Option<&str>

Source§

fn replace_impl(self, haystack: &str, to: &str) -> String

Source§

fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String

Source§

fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>

Source§

fn trim_end_matches_impl(self, haystack: &str) -> &str

Source§

impl Searchable for &[char]

Available on crate feature 1.0 only.
Source§

type Split<'a> = Split<'a, &[char]>

Source§

type RSplit<'a> = RSplit<'a, &[char]>

Source§

type SplitTerminator<'a> = SplitTerminator<'a, &[char]>

Source§

type RSplitTerminator<'a> = RSplitTerminator<'a, &[char]>

Source§

type SplitN<'a> = SplitN<'a, &[char]>

Source§

type RSplitN<'a> = RSplitN<'a, &[char]>

Source§

type Matches<'a> = Matches<'a, &[char]>

Source§

type RMatches<'a> = RMatches<'a, &[char]>

Source§

type MatchIndices<'a> = MatchIndices<'a, &[char]>

Source§

type RMatchIndices<'a> = RMatchIndices<'a, &[char]>

Source§

type SplitInclusive<'a> = SplitInclusive<'a, &[char]>

Source§

fn contains_impl(self, haystack: &str) -> bool

Source§

fn starts_with_impl(self, haystack: &str) -> bool

Source§

fn ends_with_impl(self, haystack: &str) -> bool

Source§

fn find_impl(self, haystack: &str) -> Option<usize>

Source§

fn rfind_impl(self, haystack: &str) -> Option<usize>

Source§

fn split_impl(self, haystack: &str) -> Self::Split<'_>

Source§

fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>

Source§

fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>

Source§

fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>

Source§

fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>

Source§

fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>

Source§

fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn matches_impl(self, haystack: &str) -> Self::Matches<'_>

Source§

fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>

Source§

fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>

Source§

fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>

Source§

fn trim_start_matches_impl(self, haystack: &str) -> &str

Source§

fn strip_prefix_impl(self, haystack: &str) -> Option<&str>

Source§

fn strip_suffix_impl(self, haystack: &str) -> Option<&str>

Source§

fn replace_impl(self, haystack: &str, to: &str) -> String

Source§

fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String

Source§

fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>

Source§

fn trim_end_matches_impl(self, haystack: &str) -> &str

Source§

impl Searchable for char

Available on crate feature 1.0 only.
Source§

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

Source§

type RSplit<'a> = RSplit<'a, char>

Source§

type SplitTerminator<'a> = SplitTerminator<'a, char>

Source§

type RSplitTerminator<'a> = RSplitTerminator<'a, char>

Source§

type SplitN<'a> = SplitN<'a, char>

Source§

type RSplitN<'a> = RSplitN<'a, char>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type SplitInclusive<'a> = SplitInclusive<'a, char>

Source§

fn contains_impl(self, haystack: &str) -> bool

Source§

fn starts_with_impl(self, haystack: &str) -> bool

Source§

fn ends_with_impl(self, haystack: &str) -> bool

Source§

fn find_impl(self, haystack: &str) -> Option<usize>

Source§

fn rfind_impl(self, haystack: &str) -> Option<usize>

Source§

fn split_impl(self, haystack: &str) -> Self::Split<'_>

Source§

fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>

Source§

fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>

Source§

fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>

Source§

fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>

Source§

fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>

Source§

fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn matches_impl(self, haystack: &str) -> Self::Matches<'_>

Source§

fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>

Source§

fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>

Source§

fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>

Source§

fn trim_start_matches_impl(self, haystack: &str) -> &str

Source§

fn strip_prefix_impl(self, haystack: &str) -> Option<&str>

Source§

fn strip_suffix_impl(self, haystack: &str) -> Option<&str>

Source§

fn replace_impl(self, haystack: &str, to: &str) -> String

Source§

fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String

Source§

fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>

Source§

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.
Source§

type Split<'a> = Split<'a, &[char; N]>

Source§

type RSplit<'a> = RSplit<'a, &[char; N]>

Source§

type SplitTerminator<'a> = SplitTerminator<'a, &[char; N]>

Source§

type RSplitTerminator<'a> = RSplitTerminator<'a, &[char; N]>

Source§

type SplitN<'a> = SplitN<'a, &[char; N]>

Source§

type RSplitN<'a> = RSplitN<'a, &[char; N]>

Source§

type Matches<'a> = Matches<'a, &[char; N]>

Source§

type RMatches<'a> = RMatches<'a, &[char; N]>

Source§

type MatchIndices<'a> = MatchIndices<'a, &[char; N]>

Source§

type RMatchIndices<'a> = RMatchIndices<'a, &[char; N]>

Source§

type SplitInclusive<'a> = SplitInclusive<'a, &[char; N]>

Source§

fn contains_impl(self, haystack: &str) -> bool

Source§

fn starts_with_impl(self, haystack: &str) -> bool

Source§

fn ends_with_impl(self, haystack: &str) -> bool

Source§

fn find_impl(self, haystack: &str) -> Option<usize>

Source§

fn rfind_impl(self, haystack: &str) -> Option<usize>

Source§

fn split_impl(self, haystack: &str) -> Self::Split<'_>

Source§

fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>

Source§

fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>

Source§

fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>

Source§

fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>

Source§

fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>

Source§

fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn matches_impl(self, haystack: &str) -> Self::Matches<'_>

Source§

fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>

Source§

fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>

Source§

fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>

Source§

fn trim_start_matches_impl(self, haystack: &str) -> &str

Source§

fn strip_prefix_impl(self, haystack: &str) -> Option<&str>

Source§

fn strip_suffix_impl(self, haystack: &str) -> Option<&str>

Source§

fn replace_impl(self, haystack: &str, to: &str) -> String

Source§

fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String

Source§

fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>

Source§

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.
Source§

type Split<'a> = Split<'a, [char; N]>

Source§

type RSplit<'a> = RSplit<'a, [char; N]>

Source§

type SplitTerminator<'a> = SplitTerminator<'a, [char; N]>

Source§

type RSplitTerminator<'a> = RSplitTerminator<'a, [char; N]>

Source§

type SplitN<'a> = SplitN<'a, [char; N]>

Source§

type RSplitN<'a> = RSplitN<'a, [char; N]>

Source§

type Matches<'a> = Matches<'a, [char; N]>

Source§

type RMatches<'a> = RMatches<'a, [char; N]>

Source§

type MatchIndices<'a> = MatchIndices<'a, [char; N]>

Source§

type RMatchIndices<'a> = RMatchIndices<'a, [char; N]>

Source§

type SplitInclusive<'a> = SplitInclusive<'a, [char; N]>

Source§

fn contains_impl(self, haystack: &str) -> bool

Source§

fn starts_with_impl(self, haystack: &str) -> bool

Source§

fn ends_with_impl(self, haystack: &str) -> bool

Source§

fn find_impl(self, haystack: &str) -> Option<usize>

Source§

fn rfind_impl(self, haystack: &str) -> Option<usize>

Source§

fn split_impl(self, haystack: &str) -> Self::Split<'_>

Source§

fn rsplit_impl(self, haystack: &str) -> Self::RSplit<'_>

Source§

fn split_terminator_impl(self, haystack: &str) -> Self::SplitTerminator<'_>

Source§

fn rsplit_terminator_impl(self, haystack: &str) -> Self::RSplitTerminator<'_>

Source§

fn splitn_impl(self, haystack: &str, n: usize) -> Self::SplitN<'_>

Source§

fn rsplitn_impl(self, haystack: &str, n: usize) -> Self::RSplitN<'_>

Source§

fn split_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn rsplit_once_impl(self, haystack: &str) -> Option<(&str, &str)>

Source§

fn matches_impl(self, haystack: &str) -> Self::Matches<'_>

Source§

fn rmatches_impl(self, haystack: &str) -> Self::RMatches<'_>

Source§

fn match_indices_impl(self, haystack: &str) -> Self::MatchIndices<'_>

Source§

fn rmatch_indices_impl(self, haystack: &str) -> Self::RMatchIndices<'_>

Source§

fn trim_start_matches_impl(self, haystack: &str) -> &str

Source§

fn strip_prefix_impl(self, haystack: &str) -> Option<&str>

Source§

fn strip_suffix_impl(self, haystack: &str) -> Option<&str>

Source§

fn replace_impl(self, haystack: &str, to: &str) -> String

Source§

fn replacen_impl(self, haystack: &str, to: &str, count: usize) -> String

Source§

fn split_inclusive_impl(self, haystack: &str) -> Self::SplitInclusive<'_>

Source§

fn trim_end_matches_impl(self, haystack: &str) -> &str

Implementors§

Source§

impl<F> Searchable for F
where F: FnMut(char) -> bool,

Available on crate feature 1.0 only.
Source§

type Split<'a> = Split<'a, F>

Source§

type RSplit<'a> = RSplit<'a, F>

Source§

type SplitTerminator<'a> = SplitTerminator<'a, F>

Source§

type RSplitTerminator<'a> = RSplitTerminator<'a, F>

Source§

type SplitN<'a> = SplitN<'a, F>

Source§

type RSplitN<'a> = RSplitN<'a, F>

Source§

type Matches<'a> = Matches<'a, F>

Source§

type RMatches<'a> = RMatches<'a, F>

Source§

type MatchIndices<'a> = MatchIndices<'a, F>

Source§

type RMatchIndices<'a> = RMatchIndices<'a, F>

Source§

type SplitInclusive<'a> = SplitInclusive<'a, F>