Crate substitute

Crate substitute 

Source
Expand description

trivial string templates based on the FORTH word of the same name.

the primary advantage over str::replace is that it can perform multiple replacements while only allocating one new string.

a template is a string that contains several substitutions.

a substitution starts with ‘%’, then has any number of of charachers in its name, then ends with ‘%’. substitution names are case-sensitive.

a Substituter maps a substitution name to its replacement

the substitution %% always has the replacment %. this is to allow escaping of literal percentage signs.

has no_std support, and can support str and [u8] templates.

Structs§

Error
an error that occured during substitution

Enums§

ErrorKind

Traits§

Output
Substituter

Functions§

substitute_into
the core substitution function.