Loading tutorials
let bindings, structs, and the println! macro. You should know what an expression and a type are, and be able to build and run a project with Cargo. You do not need to have written a macro before.3 min readlet bindings, and structs, and that you can build and run a project with Cargo. You should also know that println! is a macro. Here you define a macro, invoke it, and see what the compiler does with it.3 min readmacro_rules! macro. It also assumes you know what an expression, an identifier, and a type are in Rust. Fragment specifiers such as $a:expr appear here without detail. The next chapter covers them.3 min readmacro_rules! macro with several arms, and that you know Rust expressions, types, and identifiers. A fragment specifier tells the macro parser what kind of syntax a matcher variable captures.3 min readmacro_rules! macro and know the common fragment specifiers (expr, ident, ty). Repetitions and hygiene get their own chapters, so they appear here only briefly.2 min readmacro_rules! macro with several arms, and that you know the expr and ident fragment specifiers and how a transcriber builds the expanded code. Here you will make macros accept any number of arguments.2 min readmacro_rules! macro with several rules, use fragment specifiers such as expr and ident, and write repetitions with $(...).3 min readmacro_rules! macro with expr and ident fragments and a transcriber. It covers how Rust decides which names a macro body and its caller can see.2 min readmacro_rules! macro with ident, ty, and expr fragments and a repetition such as $(...),*. It also assumes you know how struct, impl, and trait items work in plain Rust. Here you will use those pieces to make a macro produce whole items instead of e2 min readmacro_rules! macro and understand Rust modules and pub. It covers where a macro can be called, how to share one across files and crates, and how to keep it working when other crates call it.2 min readmacro_rules! rules with matchers, fragment specifiers, and repetitions. You should also know that a transcriber is the code a rule expands to.2 min readmacro_rules! macro with several rules, use fragment specifiers such as expr and tt, and run cargo build. It covers how to see what a macro expands to and how to read the errors the compiler reports when expansion fails.2 min readmacro_rules! macros, use tt and expr fragments, and have seen recursive macros. If recursion is new to you, read the chapter on recursive macros first.2 min readmacro_rules! macros with fragment specifiers and repetitions, and that you know recursion and $crate. Here you learn where declarative macros stop being the right tool and what to use instead.3 min read