about this book
The goal of this book is to teach the advantages, disadvantages, and common use cases of Rust macros. The reader will learn what makes #[derive(Debug)]
work, how tokio
transforms an asynchronous main
function, or how yew
checks HTML for errors. They will write macros to avoid boilerplate and duplication or Domain-Specific Languages that make everyone else’s life easier and—this is Rust after all—safer. Tests will help you ensure the correct behavior of those macros, while precise error messages give users a great idea of what goes wrong when they leave the happy path. Debugging issues arise frequently, and it’s an experience that teaches us to better handle issues with other people’s macros. As a bonus, the reader will probably pick up some additional knowledge about a load of other programming topics.
Who should read this book?
If Hello, World! did print, congratulations! […] That makes you a Rust programmer.