Chapter 1: Foundations
Chapter 2: Types
Chapter 3: Designing Interfaces
Chapter 4: Error Handling
Chapter 5: Project Structure
Chapter 6: Testing
Chapter 7: Macros
Chapter 8: Asynchronous Programming
Chapter 9: Unsafe Code
Chapter 10: Concurrency (and Parallelism)
Chapter 11: Foreign Function Interfaces
Chapter 12: Rust Without the Standard Library
Chapter 13: The Rust Ecosystem
Rust for Rustaceans
For developers who’ve mastered the basics, this book is the next step on your way to professional-level programming in Rust. It covers everything you need to build and maintain larger code bases, write powerful and flexible applications and libraries, and confidently expand the scope and complexity of your projects.
Author Jon Gjengset takes you deep into the Rust programming language, dissecting core topics like ownership, traits, concurrency, and unsafe code. You’ll explore key concepts like type layout and trait coherence, delve into the inner workings of concurrent programming and asynchrony with async/await, and take a tour of the world of no_std programming. Gjengset also provides expert guidance on API design, testing strategies, and error handling, and will help develop your understanding of foreign function interfaces, object safety, procedural macros, and much more.
- How to design reliable, idiomatic, and ergonomic Rust programs based on best principles
- Effective use of declarative and procedural macros, and the difference between them
- How asynchrony works in Rust – all the way from the Pin and Waker types used in manual implementations of Futures, to how async/await saves you from thinking about most of those words
- What it means for code to be unsafe, and best practices for writing and interacting with unsafe functions and traits
- How to organize and configure more complex Rust projects so that they integrate nicely with the rest of the ecosystem
- How to write Rust code that can interoperate with non-Rust libraries and systems, or run in constrained and embedded environments
Brimming with practical, pragmatic insights that you can immediately apply, Rust for Rustaceans helps you do more with Rust, while also teaching you its underlying mechanisms.
"You'll learn dozens—probably hundreds—of things about how to improve your Rust programming by reading this book."
—Tim McNamara, author of Rust in Action
"One of Rust's weaknesses as a language is there's a lot of beginner content and a lot of advanced content, but any intermediate content is just nonexistent or requires quite the struggle to learn. Jon Gjengset has done a wonderful job of distilling those next steps into an easy to read book."
—Michael Gattozzi, Senior Software Engineer, Fastly
"For a long time, people have asked me what they should read after The Rust Programming Language. Rust for Rustaceans is that book. This book will teach you how to effectively *use* Rust, after you've understood the core syntax and semantics of the language itself. Rust has a rich number of tools for you to choose from, and Rust for Rustaceans will show them all off, and teach you how to properly take advantage of all the richness Rust has to offer."
—Steve Klabnik, co-author of The Rust Programming Language
"Rust for Rustaceans is such a good book (for folks who already know rust)!"
—Ron Bowes, @iagox86