Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
- The macro
include!
can be used to inline the conent of file as long as the resulted Rust code is valid! It can be extremely flexible, however, the included file is placed in the surrounding code unhygienically. It is suggested that you limited the use ofinclude!
Develop Macros in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Useful Crates for Macro Development¶
syn¶
Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree of Rust source code.
quote¶
Quote
provides the quote!
macro
for turning Rust syntax tree data structures into tokens of source code.
Generic and Specialization in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!