Practical handbook
The Rust Engineering Handbook
A production-minded reference for reasoning about Rust's ownership, type, concurrency, API, unsafe, compatibility, and operational contracts.
Reading order
Contents
Part 1
Rust as an Engineering System
5 entries
Part 1
Rust as an Engineering System
Part 2
Part II — Ownership, Borrowing, and Destruction
7 entries
Part 2
Part II — Ownership, Borrowing, and Destruction
- 06 Moves, Copies, Clones, and Partial Moves
- 07 Shared and Mutable Borrowing
- 08 Lifetimes as Relationships
- 09 Reborrowing, Non-Lexical Lifetimes, Two-Phase Borrows, and Higher-Ranked Bounds
- 10 Interior Mutability
- 11 RAII, Drop, Destruction Order, Leaks, and Cycles
- 12 Ownership-Driven Refactoring and Architecture
Part 3
Part III — Algebraic Data and Pattern-Directed Design
5 entries
Part 3
Part III — Algebraic Data and Pattern-Directed Design
Part 4
Part IV — Generics, Traits, and Abstraction
8 entries
Part 4
Part IV — Generics, Traits, and Abstraction
- 18 Generics, Bounds, and Monomorphization
- 19 Traits and Associated Items
- 20 Coherence, Orphan Rules, and Extension Patterns
- 21 Static Dispatch, Dynamic Dispatch, and dyn Compatibility
- 22 Closures and the Fn Trait Family
- 23 Iterator Architecture and Lazy Pipelines
- 24 Conversion, Borrowing, Dereference, and View Traits
- 25 Advanced Type Patterns
Part 5
Data memory and representation
8 entries
Part 5
Data memory and representation
- 26 Layout, Alignment, Niches, and Representation
- 27 Pointers and Smart Pointers
- 28 Slices, Strings, Bytes, and UTF-8
- 29 Collections and Ownership-Aware Data Structures
- 30 Dynamically Sized Types, Fat Pointers, Unsizing, and Trait Objects
- 31 Pinning and Self-Referential Constraints
- 32 Allocation Strategies, Arenas, Pools, and Allocation-Free Paths
- 33 Zero-Copy Parsing and Borrowed Data Models
Part 6
Errors panics and robustness contracts
4 entries
Part 6
Errors panics and robustness contracts
Part 7
Cargo crates and system architecture
7 entries
Part 7
Cargo crates and system architecture
- 38 Packages, Crates, Modules, Visibility, and the Prelude
- 39 Workspaces and Multi-Crate Architecture
- 40 Manifests, Dependency Resolution, and Lockfiles
- 41 Features, Conditional Compilation, Targets, and Portability
- 42 Build Scripts, Native Dependencies, and Generated Code
- 43 Profiles, Linkers, Cross-Compilation, and Reproducible Builds
- 44 Editions, MSRV, SemVer, and Release Engineering
Part 8
Public API and library design
7 entries
Part 8
Public API and library design
- 45 Ownership Choices in Function and Type Signatures
- 46 Designing Public Types and Traits for Evolution
- 47 Builders, Configuration, and Typestate APIs
- 48 Generic, Concrete, and Dynamic Boundaries
- 49 Error, Cancellation, and Async Contracts in Public APIs
- 50 Rustdoc, Examples, Discoverability, and Feature Documentation
- 51 API Review and Compatibility Case Study
Part 9
Threads synchronization and parallelism
6 entries
Part 9
Threads synchronization and parallelism
- 52 Send, Sync, and Thread-Safety Boundaries
- 53 Threads, Scoped Threads, and Work Decomposition
- 54 Channels and Ownership Transfer
- 55 Shared State: Mutexes, Read-Write Locks, Condition Variables, and One-Time Initialization
- 56 Atomics and the Memory Model
- 57 Contention, Deadlocks, Lock-Free Structures, and Data Parallelism
Part 10
Async rust and networked systems
8 entries
Part 10
Async rust and networked systems
- 58 Future, Poll, Waker, and the Generated State Machine
- 59 async/.await Borrowing, Lifetimes, Send, and Pinning
- 60 Executors, Reactors, Runtimes, and Runtime Boundaries
- 61 Tasks, Cancellation, Structured Concurrency, and Shutdown
- 62 Streams, Backpressure, Buffering, and Fairness
- 63 Timeouts, Retries, Racing, and Idempotent I/O
- 64 Async Traits, Service Abstractions, and Testing
- 65 Production Async Service Case Study
Part 11
Unsafe rust and foreign boundaries
9 entries
Part 11
Unsafe rust and foreign boundaries
- 66 The Unsafe Contract and Safety-Case Method
- 67 Validity, Initialization, MaybeUninit, and ManuallyDrop
- 68 Raw Pointers, Provenance, Aliasing, and References
- 69 Building Safe Abstractions Around Unsafe Internals
- 70 Representation, Unions, Bit Operations, and Transmutation
- 71 Unsafe Traits, Send/Sync, Drop Safety, and Panic Safety
- 72 C ABI and FFI: Ownership, Errors, Callbacks, and Unwinding
- 73 Cross-Language Bindings and Boundary Architecture
- 74 Miri, Sanitizers, Fuzzing, and Unsafe Audits
Part 12
Macros and compile time engineering
4 entries
Part 12
Macros and compile time engineering
Part 13
Testing verification and quality gates
5 entries
Part 13
Testing verification and quality gates
Part 14
Performance operations and security
10 entries
Part 14
Performance operations and security
- 84 Measurement and Benchmark Design
- 85 Rust’s Cost Model: Allocation, Copies, Dispatch, Syscalls, and Caches
- 86 Compiler Optimization, Inlining, LTO, PGO, and Code Size
- 87 Profiling CPU, Memory, I/O, Locks, and Async Tasks
- 88 Observability: Structured Events, Metrics, Errors, and Backtraces
- 89 Production I/O, Configuration, Secrets, Shutdown, and Deployment
- 90 Resilience Under Load: Admission Control, Backpressure, and Degradation
- 91 Security Engineering: Memory Safety Is Not a Threat Model
- 92 Dependency Governance, SBOMs, Advisories, and Reproducible Supply Chains
- 93 Production Readiness and Performance Case Study
Part 15
Platforms adoption and technical leadership
6 entries
Part 15
Platforms adoption and technical leadership
- 94 no_std, alloc, Embedded Systems, and Firmware
- 95 WebAssembly, Kernels, Drivers, and Constrained Runtimes
- 96 Application Archetypes: CLI, Library, Service, Data Plane, and Compute
- 97 Migration from C, C++, Go, Java, and Existing Systems
- 98 Team Standards, Code Review, Mentoring, and Unsafe Governance
- 99 Long-Term Maintenance: Editions, MSRV, Incidents, and Ecosystem Change
Reference section
Appendices
20 entries
Reference section
Appendices
- Appendix A Appendix A — Rust Syntax and Reading Reference
- Appendix B Appendix B — Ownership and Borrowing Decision Tables
- Appendix C Appendix C — Lifetime Pattern Catalog
- Appendix D Appendix D — Trait and Dispatch Reference
- Appendix E Appendix E — Conversion and View Trait Matrix
- Appendix F Appendix F — Standard-Library Type Selection Guide
- Appendix G Appendix G — Numeric and Bitwise Correctness Checklist
- Appendix H Appendix H — Error and Panic Design Checklist
- Appendix I Appendix I — Cargo and Workspace Reference
- Appendix J Appendix J — Public API Review Checklist
- Appendix K Appendix K — Unsafe Code Review Checklist
- Appendix L Appendix L — FFI Boundary Checklist
- Appendix M Appendix M — Concurrency and Async Review Checklist
- Appendix N Appendix N — Memory-Ordering Litmus Reference
- Appendix O Appendix O — Performance Experiment Template
- Appendix P Appendix P — Security and Supply-Chain Checklist
- Appendix Q Appendix Q — Edition, MSRV, SemVer, and Release Policy Templates
- Appendix R Appendix R — Code Review Checklist
- Appendix S Appendix S — Glossary and Terminology Cross-Reference
- Appendix T Appendix T — Source Map and Further Reading