Summary
In this chapter we covered some useful patterns that will take our code to the next level. We can enable multiple permissions for a struct using multiple traits. We then scaled our ability to write Rust code with macros where we mapped data contracts with functions to handle them. Finally, we revisited traits to configure functions and implemented the type-state pattern to lock down our struct.
These approaches can help you solve problems in Rust in an elegant, secure, and scalable way. You can use these approaches to solve problems you generally come across outside of web programming too. Throughout the book, we will be revisiting these approaches to solve problems in web programming. Hopefully with these approaches, you can see that Rust is a safe, yet flexible and powerful language. Whenever I am feeling a little too sure of myself, I remind myself that some super smart people came up with the Rust programming language and traits. This always reminds me of how much smarter...