11 Multiple threads and a lot more

This chapter covers

  • The todo! macro to make the compiler quiet for a while
  • Type aliases to create different names but not new types
  • The Cow enum, which allows you to choose to borrow or own data however you want
  • Rc, which allows shared instead of unique ownership
  • Using multiple threads to run many things at the same time

You’re getting pretty good at Rust by now, so it’s time to take a look at some more advanced types. This chapter doesn’t really have a single theme. Instead, we’ll look in turn at some advanced subjects: Cow, type aliases, Rc, and multiple threads. Understanding how multiple threads work is probably the hardest part of this chapter. The famous Cow type (yes, that’s its real name) is a little ...

Get Learn Rust in a Month of Lunches now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.