Function string
fn string<impl FnMut(usize, &mut String): FnMut(usize, &mut alloc::string::String), impl FnMut(&str) -> Option<usize>: FnMut(&str) -> Option<usize>>(replacement: &str, append: impl FnMut(usize, &mut String), name_to_index: impl FnMut(&str) -> Option<usize>, dst: &mut String)
Accepts a replacement string and interpolates capture references with their corresponding values.
append should be a function that appends the string value of a capture
group at a particular index to the string given. If the capture group
index is invalid, then nothing should be appended.
name_to_index should be a function that maps a capture group name to a
capture group index. If the given name doesn't exist, then None should
be returned.
Finally, dst is where the final interpolated contents should be written.
If replacement contains no capture group references, then dst will be
equivalent to replacement.
See the module documentation for details about the format supported.
Example
use interpolate;
let mut dst = Stringnew;
string;
assert_eq!;