Crates.io | include_tt |
lib.rs | include_tt |
version | 1.1.0 |
created_at | 2023-07-23 16:35:07.262125+00 |
updated_at | 2025-08-03 21:26:08.890669+00 |
description | Macros for ultra-flexible injection of compiler trees, literals, or binary data into Rust syntax trees from external sources. |
homepage | |
repository | https://github.com/clucompany/include_tt.git |
max_upload_size | |
id | 923838 |
size | 60,192 |
[include_tt]
(Macros for ultra-flexible injection of compiler trees, literals, or binary data into Rust syntax trees from external sources.)
Add this to your Cargo.toml:
[dependencies]
include_tt = "1.1.0"
and this to your source code:
use include_tt::inject;
use include_tt::inject;
use std::fmt::Write;
fn main() {
let mut buf = String::new();
inject! {
write!(
&mut buf,
"Welcome, {}. Your score is {}.",
#tt("examples/name.tt"), // `"Ferris"`
#tt("examples/" "score" ".tt") // `100500`
).unwrap();
}
assert_eq!(buf, "Welcome, Ferris. Your score is 100500.");
}
See all
This project has a dual license according to (LICENSE-MIT) and (LICENSE-APACHE-2-0).