Trait LazyReplace

Source
pub trait LazyReplace {
    // Required method
    fn lazy_replace<P, R>(
        &self,
        pat: P,
        replacement: R,
    ) -> ReplacedString<'_, P, R>;
}
Expand description

A convenience trait to allow you to call .lazy_replace on anything that can deref to a &str.

Required Methods§

Source

fn lazy_replace<P, R>(&self, pat: P, replacement: R) -> ReplacedString<'_, P, R>

Create a struct implementing Display that will display this string with the specified pattern replaced with the specified replacement

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 LazyReplace for str

Source§

fn lazy_replace<P, R>( &self, needle: P, replacement: R, ) -> ReplacedString<'_, P, R>

Implementors§

Source§

impl<T> LazyReplace for T
where T: Deref<Target = str>,