Skip to Content
Idiomatic Rust
book

Idiomatic Rust

by Brenden Matthews
September 2024
Intermediate to advanced
256 pages
6h 40m
English
Manning Publications

Overview

Tips, tricks, design patterns, and secret features of Rust that will help you build stable and maintainable applications.

Whether you’re a Rust beginner or a pro, Idiomatic Rust will teach you to be a better Rust programmer. It introduces essential design patterns for Rust software with detailed explanations, and code samples that encourage you to get stuck in.

In Idiomatic Rust you’ll learn how to apply important design patterns including:

  • Fluent interfaces for creating delightful APIs
  • The Builder pattern to encapsulate data and perform initialization
  • Immutable data structures that help you avoid hard-to-debug data race conditions
  • Functional programming patterns
  • Anti-patterns and what not to do in Rust

Idiomatic Rust catalogs, documents, and describes both how classic design patterns work with Rust, and the new Rust-specific patterns that will help you master the language. Each pattern or best practice helps solve common programming problems and ensure your code is easy for others to understand. You’ll learn when to use each pattern—and when to break it! You’ll soon be producing higher-quality Rust code and higher-quality Rust software.

About the Technology
After you’re comfortable with Rust’s syntax and its uniquely-powerful compiler, there’s a whole new dimension to explore as you put it to use in real projects. How do you apply standard design patterns in Rust applications? Where and why should you use IntoIterator? Why do Rustaceans love the PhantomData type? This book answers these questions and many, many more.

About the Book
Idiomatic Rust introduces the coding and design patterns you’ll need to take advantage of Rust’s unique language design. This book’s clear explanations and reusable code examples help you explore metaprogramming, build your own libraries, create fluent interfaces, and more. Along the way, you’ll learn how to write efficient, idiomatic Rust code that’s easy to maintain and evolve as you learn how the language works under the hood.

What's Inside
  • Creating delightful APIs
  • Applying Builder and other classic design patterns
  • Functional programming patterns
  • Rust anti-patterns


About the Reader
For intermediate Rust programmers.

About the Author
Brenden Matthews is a member of the Apache Software Foundation, creator of the system monitor Conky, and author of Code Like a Pro in Rust.

The technical editor on this book was Alain M Couniot.

Quotes
It’s a no-brainer to have this one on your shelf!
- Bastian Gruber, Mozilla

Think like a Rustacean! This book is for anyone who wants to fully internalize what idiomatic Rust looks like.
- David MacLeod, SurrealDB

Rust in depth. The real nitty-gritty of Rust!
- Yves Dorfsman, SollerS Inc.

An indispensable guide for mastering idiomatic Rust, offering practical patterns and best practices to elevate your code quality.
- Giuseppe Catalano, Engineering Ingegneria Informatica S.p.A.

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