An open API service indexing awesome lists of open source software.

https://github.com/clucompany/include_tt

[stable] Macro for embedding (trees, strings, arrays) into macro trees directly from files.
https://github.com/clucompany/include_tt

clucompany code-generation code-transformation file-io macro procedural-macros

Last synced: 3 months ago
JSON representation

[stable] Macro for embedding (trees, strings, arrays) into macro trees directly from files.

Awesome Lists containing this project

README

          

[include_tt]

(Macros for ultra-flexible injection of compiler trees, literals, or binary data into Rust syntax trees from external sources.)



mit


apache2


cratesio


docrs


uproject


clulab


[![CI](https://github.com/clucompany/include_tt/actions/workflows/CI.yml/badge.svg?event=push)](https://github.com/clucompany/include_tt/actions/workflows/CI.yml)


## Usage

Add this to your Cargo.toml:

```toml
[dependencies]
include_tt = "1.1.0"
```

and this to your source code:

```rust
use include_tt::inject;
```

## Example

```rust
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

## License

This project has a dual license according to (LICENSE-MIT) and (LICENSE-APACHE-2-0).



uproject

 Copyright (c) 2023-2025 #UlinProject

 (Denis Kotlyarov).

### Apache License



apache2


 Licensed under the Apache License, Version 2.0.

### MIT License



mit

 Licensed under the MIT License.