Funcy is a simple function based template engine.
```rust
struct Echo();
impl funcy::PlaceholderFunction for Echo {
fn placeholderfnhandler<'a>(&mut self, name: &'a str, arg: &'a str) -> Result
let mut tr = funcy::TemplateRenderer::withtemplate(", World!"); tr.setplaceholderfn("echo", Box::new(Echo())); asserteq!(tr.render().unwrap(), "Hello, World!"); ```
```rust
struct Counter(usize);
impl funcy::PlaceholderFunction for Counter {
fn placeholderfnhandler<'a>(&mut self, name: &'a str, _arg: &'a str) -> Result
let mut tr = funcy::TemplateRenderer::withtemplate(" ") let counter = Counter(0); tr.setplaceholderfn("counter", Box::new(counter)); asserteq!(tr.render().unwrap(), "1 2 3"); ```
Funcy is distributed under the Apache-2.0 license. See the LICENSE file.