Skip to Content
Idiomatic Rust
book

Idiomatic Rust

by Brenden Matthews
September 2024
Intermediate to advanced
256 pages
6h 40m
English
Manning Publications
Content preview from Idiomatic Rust

2 Rust’s basic building blocks

This chapter covers

  • Exploring the core Rust patterns
  • Diving into Rust generics
  • Exploring traits
  • Combining generics and traits
  • Deriving traits automatically

In this chapter, I’ll introduce and discuss some of Rust’s most important abstractions and features, which I call building blocks and which serve as the foundation of nearly all design patterns in Rust. Reviewing and understanding these building blocks before diving deeper into other patterns is crucial. For some readers, this chapter may appear to be a review of language basics; it sets the stage for more advanced topics, however, so I recommend that you don’t skip it.

We’ll begin by discussing generics and traits in Rust. They are the core building ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Rust in Action

Rust in Action

Tim McNamara
Effective Rust

Effective Rust

David Drysdale
The Rust Programming Language, 2nd Edition

The Rust Programming Language, 2nd Edition

Steve Klabnik, Carol Nichols

Publisher Resources

ISBN: 9781633437463Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link