markings
A simple string-based template 'language'
This simply allows you to replace ${key} in a string with a 'Val' that impls. std::fmt::Display
Simple usage
use ;
// template strings are simply just ${key} markers in a string
// they are replaced with a cooresponding value when .apply() is used
let input = "hello ${name}, an answer: ${greeting}.";
// parse a template with the default options
// templates are clonable, they are 'consumed' on application.
let template = parse.unwrap;
// construct some replacement args, this is reusable
let args = new
// with constructs a key:val pair,
// key must be a &str,
// value is anything that implements std::fmt::Display
.with
.with;
// apply the pre-computed args to the template, consuming the template
let output = template.apply.unwrap;
assert_eq!;
License: 0BSD