Trait StringExt

Source
pub trait StringExt {
    // Required methods
    fn replacen_in_place(&mut self, from: &str, limit: usize, to: &str) -> bool;
    fn replace_in_place(&mut self, from: &str, to: &str) -> bool;
    fn replacen_in_place_regex(
        &mut self,
        from: &Regex,
        limit: usize,
        to: &str,
    ) -> bool;
    fn replace_in_place_regex(&mut self, from: &Regex, to: &str) -> bool;
    fn replacen_in_place_regex_cb<'a>(
        &mut self,
        from: &Regex,
        limit: usize,
        replacer: impl FnMut(&str, &CaptureLocations) -> Option<Cow<'a, str>> + 'a,
    ) -> bool;
    fn replace_in_place_regex_cb<'a>(
        &mut self,
        from: &Regex,
        replacer: impl FnMut(&str, &CaptureLocations) -> Option<Cow<'a, str>> + 'a,
    ) -> bool;
    fn extend_join(
        &mut self,
        it: impl Iterator<Item = impl AsRef<str>>,
        sep: &str,
    );
    fn extend_sep(&mut self, sep: &str, s: &str);
    fn push_indented_lines(&mut self, indent: Indent, val: &str);
    fn bump_counter(&mut self);
    fn cleanup_name(&mut self);
}

Required Methods§

Source

fn replacen_in_place(&mut self, from: &str, limit: usize, to: &str) -> bool

Source

fn replace_in_place(&mut self, from: &str, to: &str) -> bool

Source

fn replacen_in_place_regex( &mut self, from: &Regex, limit: usize, to: &str, ) -> bool

Source

fn replace_in_place_regex(&mut self, from: &Regex, to: &str) -> bool

Source

fn replacen_in_place_regex_cb<'a>( &mut self, from: &Regex, limit: usize, replacer: impl FnMut(&str, &CaptureLocations) -> Option<Cow<'a, str>> + 'a, ) -> bool

Source

fn replace_in_place_regex_cb<'a>( &mut self, from: &Regex, replacer: impl FnMut(&str, &CaptureLocations) -> Option<Cow<'a, str>> + 'a, ) -> bool

Source

fn extend_join(&mut self, it: impl Iterator<Item = impl AsRef<str>>, sep: &str)

Source

fn extend_sep(&mut self, sep: &str, s: &str)

Source

fn push_indented_lines(&mut self, indent: Indent, val: &str)

Source

fn bump_counter(&mut self)

Source

fn cleanup_name(&mut self)

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 StringExt for String

Source§

fn replacen_in_place(&mut self, from: &str, limit: usize, to: &str) -> bool

Source§

fn replace_in_place(&mut self, from: &str, to: &str) -> bool

Source§

fn replacen_in_place_regex( &mut self, from: &Regex, limit: usize, to: &str, ) -> bool

Source§

fn replace_in_place_regex(&mut self, from: &Regex, to: &str) -> bool

Source§

fn replacen_in_place_regex_cb<'a>( &mut self, from: &Regex, limit: usize, replacer: impl FnMut(&str, &CaptureLocations) -> Option<Cow<'a, str>> + 'a, ) -> bool

Source§

fn replace_in_place_regex_cb<'a>( &mut self, from: &Regex, replacer: impl FnMut(&str, &CaptureLocations) -> Option<Cow<'a, str>> + 'a, ) -> bool

Source§

fn extend_join( &mut self, it: impl IntoIterator<Item = impl AsRef<str>>, sep: &str, )

Source§

fn extend_sep(&mut self, sep: &str, s: &str)

Source§

fn push_indented_lines(&mut self, indent: Indent, val: &str)

Source§

fn bump_counter(&mut self)

Source§

fn cleanup_name(&mut self)

Implementors§