Rust for Rustaceans: Idiomatic Programming for Experienced Developers
Best for: Developers who've already written non-trivial Rust and want to close the gap between 'it compiles' and idiomatic, library-quality Rust.
- ISBN-13: 9781718501850
- Level: advanced
- Published: 2021
Rust for Rustaceans is explicit about who it’s for: readers who already know Rust’s syntax and basic ownership rules and are past the point where a beginner book has anything left to teach them. Jon Gjengset — who built a distributed database in Rust for his PhD and has maintained several widely used crates — spends the book on the things that separate “code that compiles” from Rust that a library maintainer would be comfortable shipping: trait design and object safety, the subtleties of lifetimes beyond the basics, when and how to reach for unsafe correctly, and how the standard concurrency primitives actually work under the hood.
The chapters on API design are the standout — concrete guidance on semantic versioning implications of trait changes, when to expose a trait versus a concrete type, and how to design for future extensibility without breaking downstream users, none of which is covered with this much rigor anywhere else. The unsafe Rust chapter is similarly rare: it doesn’t just list the rules, it walks through the reasoning a reviewer uses to decide whether a given unsafe block is actually sound.
Where it’s weaker: this is not a book to learn from in a vacuum — several chapters assume you can already read moderately complex generic and trait-bound code without a warm-up, and there’s very little hand-holding if a concept doesn’t land the first time. It’s also intentionally narrow; it won’t teach you a web framework or an async runtime, just the language and library-design fundamentals that make using either one well easier.
Compared to Rust Atomics and Locks: this book covers concurrency at the level of “how do I use these primitives correctly,” while Bos’s book goes one level deeper into how the primitives themselves are built. Readers who want both should read this one first.