January 2026
Intermediate to advanced
674 pages
15h 30m
English
Knowing the syntax and borrowing rules of Rust can get us building programs. However, unlike dynamic programming languages, Rust has a strict type system. If you do not know how to get creative with traits, you can end up creating a lot of excessive code to solve problems. In this chapter, we will cover how to enforce certain parameter checks with traits, increasing the flexibility of the parameters of functions that accept structs. We will also explore metaprogramming with macros to reduce the amount of repetitive code we have to write. These macros will also enable us to simplify and effectively communicate with other developers what our code does. We will also utilize the compiler to check the state ...
Read now
Unlock full access