Trait regex::Replacer [−][src]
pub trait Replacer { fn reg_replace(&mut self, caps: &Captures<'_>) -> Cow<'_, str>; fn no_expand(&mut self) -> Option<Cow<'_, str>> { ... } }
Expand description
Replacer describes types that can be used to replace matches in a string.
Required methods
fn reg_replace(&mut self, caps: &Captures<'_>) -> Cow<'_, str>
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
).