Creating compilable Rust source code templates.
Rust source template:
```rust fn main() { println!("Hello $$replacewithstring$$!");
let some_type = <replacer::rust_type!(replace_with_type; String;)>::new();
} ```
Rust script to parse the template:
```rust use replacer::{rule::{StringRule, TypeRule}, TemplateBuilder};
fn main() { let template = TemplateBuilder::new() .rule(StringRule::new("replacewithstring", "world").unwrap()) .rule(TypeRule::new("replacewithtype", "Vec").unwrap()) .build();
println!(template.apply(include_str!(SOURCE_TEMPLATE_FROM_ABOVE)).unwrap());
} ```
Rust template that will be printed:
```rust fn main() { println!("Hello world!");
let some_type = <Vec>::new();
} ```