Part 1 Building blocks

 

We’ll begin this book by examining some of the basic building blocks of Rust design patterns. These building blocks are essential to understanding the complex patterns we’ll cover later in the book, and they’ll help you write more idiomatic Rust code. Some of these building blocks are specific to Rust; others are more general programming concepts that are particularly important in Rust.

These building blocks are effectively the vocabulary of Idiomatic Rust: Code like a Rustacean and constitute the core features of the Rust language. We can think of them as the atoms of a molecule, which we’ll combine in various ways to create complex substances (or patterns). Those patterns can be combined and architected to create an endless variety of software systems.

Building on a solid foundation allows us to achieve great heights, provided that we build a solid and sound structure with care and attention. Rust provides an excellent foundation, but ultimately, we developers are responsible for deciding how to use the tools and components at our disposal effectively.