pub trait RegexTry<F, E> {
// Required methods
fn try_replacen<'t>(
&self,
text: &'t str,
limit: usize,
rep: F,
) -> Result<Cow<'t, str>, E>;
fn try_replace<'t>(&self, text: &'t str, rep: F) -> Result<Cow<'t, str>, E>;
fn try_replace_all<'t>(
&self,
text: &'t str,
rep: F,
) -> Result<Cow<'t, str>, E>;
}
Expand description
Defines the additional methods for Regex.
The replacer is always a function of type FnMut(&Captures) -> Result<String, E>
.
Required Methods§
Sourcefn try_replacen<'t>(
&self,
text: &'t str,
limit: usize,
rep: F,
) -> Result<Cow<'t, str>, E>
fn try_replacen<'t>( &self, text: &'t str, limit: usize, rep: F, ) -> Result<Cow<'t, str>, E>
See Regex::replacen
Sourcefn try_replace<'t>(&self, text: &'t str, rep: F) -> Result<Cow<'t, str>, E>
fn try_replace<'t>(&self, text: &'t str, rep: F) -> Result<Cow<'t, str>, E>
See Regex::replace