When we build software, we spend a lot of time working with data structures. Sometimes, we need to write custom data structures, but more often than not, we use the built-in structures provided by each programming language for the majority of the work. Rust provides a rich set of flexible data structures that provide a good balance of performance, convenience, features, and customizability.
Before you go about implementing your own custom data structures, it’s worth taking the time to understand the ins and outs of the core structures included with the Rust standard library. You may find they provide enough in terms of features and flexibility to meet the needs of nearly any application. In cases where Rust’s built-in structures are insufficient, foundational knowledge of Rust’s existing data structures will be of much benefit when designing your own.
In part 2, we’ll dive into the details of Rust’s core data structures and memory management, which will provide you with some of the essential knowledge required for writing highly effective Rust. Once you learn to effectively utilize Rust’s data structures and memory management features, working with Rust gets a lot easier, too.