Book description
The Rust Programming Language, 2nd Edition is the official guide to Rust 2021: an open source systems programming language that will help you write faster, more reliable software. Rust provides control of low-level details along with high-level ergonomics, allowing you to improve productivity and eliminate the hassle traditionally associated with low-level languages.
Klabnik and Nichols, alumni of the Rust Core Team, share their knowledge to help you get the most out of Rust's features so that you can create robust and scalable programs. You'll begin with basics like creating functions, choosing data types, and binding variables, then move on to more advanced concepts, such as:
—Ownership and borrowing, lifetimes, generics, traits, and trait objects to communicate your program's constraints to the compiler
—Smart pointers and multithreading, and how ownership interacts with them to enable fearless concurrency
—How to use Cargo, Rust's built-in package manager, to build, document your code, and manage dependencies
—The best ways to test, handle errors, refactor, and take advantage of expressive pattern matching
In addition to the countless code examples, you'll find three chapters dedicated to building complete projects: a number-guessing game, a Rust implementation of a command line tool, and a multithreaded server.
Table of contents
- Title Page
- Copyright
- About the Authors
- Foreword
- Preface
- Acknowledgments
- Introduction
- Chapter 1: Getting Started
- Chapter 2: Programming a Guessing Game
- Chapter 3: Common Programming Concepts
- Chapter 4: Understanding Ownership
- Chapter 5: Using Structs to Structure Related Data
- Chapter 6: Enums and Pattern Matching
- Chapter 7: Managing Growing Projects with Packages, Crates, and Modules
- Chapter 8: Common Collections
- Chapter 9: Error Handling
-
Chapter 10: Generic Types, Traits, and Lifetimes
- Removing Duplication by Extracting a Function
- Generic Data Types
- Traits: Defining Shared Behavior
-
Validating References with Lifetimes
- Preventing Dangling References with Lifetimes
- The Borrow Checker
- Generic Lifetimes in Functions
- Lifetime Annotation Syntax
- Lifetime Annotations in Function Signatures
- Thinking in Terms of Lifetimes
- Lifetime Annotations in Struct Definitions
- Lifetime Elision
- Lifetime Annotations in Method Definitions
- The Static Lifetime
- Generic Type Parameters, Trait Bounds, and Lifetimes Together
- Summary
- Chapter 11: Writing Automated Tests
- Chapter 12: An I/O Project: Building a Command Line Program
- Chapter 13: Functional Language Features: Iterators and Closures
- Chapter 14: More About Cargo and Crates.io
- Chapter 15: Smart Pointers
- Chapter 16: Fearless Concurrency
- Chapter 17: Object-Oriented Programming Features
- Chapter 18: Patterns and Matching
- Chapter 19: Advanced Features
- Chapter 20: Final Project: Building a Multithreaded Web Server
- Appendix A: Keywords
- Appendix B: Operators and Symbols
- Appendix C: Derivable Traits
- Appendix D: Useful Development Tools
- Appendix E: Editions
- Index
Product information
- Title: The Rust Programming Language, 2nd Edition
- Author(s):
- Release date: February 2023
- Publisher(s): No Starch Press
- ISBN: 9781098156800
You might also like
book
Programming Rust, 2nd Edition
Systems programming provides the foundation for the world's computation. Writing performance-sensitive code requires a programming language …
book
Rust for Rustaceans
For developers who’ve mastered the basics, this book is the next step on your way to …
book
The Rust Programming Language (Covers Rust 2018)
The Rust Programming Language is the official book on Rust: an open source systems programming language …
book
Rust in Action
Rust in Action introduces the Rust programming language by exploring numerous systems programming concepts and techniques. …