[][src]Trait regex::Replacer

pub trait Replacer {
    fn reg_replace(&mut self, caps: &Captures) -> Cow<str>;

    fn no_expand(&mut self) -> Option<Cow<str>> { ... }
}

Replacer describes types that can be used to replace matches in a string.

Required methods

fn reg_replace(&mut self, caps: &Captures) -> Cow<str>

Returns a possibly owned string that is used to replace the match corresponding to the caps capture group.

The 'a lifetime refers to the lifetime of a borrowed string when a new owned string isn't needed (e.g., for NoExpand).

Loading content...

Provided methods

fn no_expand(&mut self) -> Option<Cow<str>>

Returns a possibly owned string that never needs expansion.

Loading content...

Implementations on Foreign Types

impl<'t> Replacer for &'t str[src]

Loading content...

Implementors

impl<'t> Replacer for NoExpand<'t>[src]

impl<F> Replacer for F where
    F: FnMut(&Captures) -> String
[src]

fn no_expand(&mut self) -> Option<Cow<str>>[src]

Loading content...