Crate do_with_in
source ·Expand description
Use-site metaprogramming inspired by staging
This crate lets you run code at compile time to produce the tokens other proc_macros will consume. It is also useful for ad-hoc in place code generation, and for making templates (like Jinja or Mustache for your code). It uses its own simple inner language based on handlers, variables, and a user chosen sigil. The stage separation model of Rust does impose some limitations on what this crate can do.
There are two common ways to use this crate. As an end user, it is most likely that you will use the do_with_in proc_macro directly. But if you want to make use of parts of the functionality in order to implement these features into your own proc_macro directly, or to implement your own handlers offering extended functionality in the staged language, you’ll end up (at this stage) using the reexports from do_with_in_base, most notably do_with_in_explicit2.
The base handler list is in genericDefaultHandlers.
Macros
- This is the proc_macro most users of this crate will use.
Structs
Enums
Traits
Functions
- The function used to actually run a stage.
- This function generates the default handler set.
- A handler that lets the end user change which sigil the code inside it uses.