Introduction

Completed

In this module, we explore how to work with the hash map compound data type in Rust. You'll discover how to implement loop expressions to iterate through data in a collection like a hash map. As an exercise, you'll write a Rust program to build cars by looping through requested orders, testing conditions, and processing data of different types.

The Rust Playground

The Rust Playground is a browser interface to the Rust compiler. You can use the Playground to experiment writing Rust code before you install the language locally, or when you might not have the compiler available. Throughout this course, we'll give Playground links to the example code and exercises. You can interact with the code, even if you don't have the Rust toolchain available at the moment.

All code that runs on the Rust Playground can also compile and run in your local development environment. Don't be discouraged to interact with the Rust compiler from your computer. You can learn more about the Rust Playground in the What is Rust? module.

Learning objectives

In this module, you'll:

  • Discover the hash map data type in Rust, and how to access keys and values
  • Explore how to use loop expressions to iterate through data in a Rust program
  • Create, compile, and run a Rust program to iterate on hash map data by using a loop