Rust¶
Rust is a systems programming language focused on performance, reliability, and memory safety without a garbage collector. Its ownership model, checked at compile time, eliminates whole classes of bugs (use-after-free, double frees, data races) while still compiling to fast native code. Paired with Cargo, its build tool and package manager, it's well suited to CLIs, network services, infrastructure tooling, and anything where correctness and speed both matter.
Guides¶
Fundamentals¶
- Understanding Ownership, Moves, and Borrowing
The core mental model behind Rust: scope and drop, moves, shared and mutable references, the borrowing rules,
Copyvs.Clone, slices, lifetimes, and smart pointers likeRc,Arc, andMutex. Includes a table of the most common ownership-related compiler errors.
Troubleshooting¶
- Fixing "use of partially moved value": Moving vs. Borrowing in Patterns
A worked example of compiler error E0382 inside a
match: why binding a field in a pattern moves it, what the compiler'srefsuggestion really means, and five idiomatic fixes.
Architecture and design¶
- Architecting Rust Projects: A Comprehensive Guide How to structure and ship Rust projects: crates, modules, and workspaces; layered architecture with traits at the boundaries; configuration, error handling, logging, and async; type-driven design, traits, iterators, and other core idioms; testing, tooling, CI, and release builds; plus common anti-patterns and a new-project checklist.
Suggested reading order¶
- Start with Ownership, Moves, and Borrowing. Nearly everything else in Rust builds on it.
- Keep Fixing "use of partially moved value" handy for when the borrow checker objects to a
match. - Read Architecting Rust Projects before starting your next non-trivial project, and use its checklist when setting one up.
External resources¶
- The Rust Programming Language: the official book
- Rust by Example: learn through annotated, runnable examples
- The Cargo Book: builds, dependencies, workspaces, and features
- Rust API Guidelines: conventions for idiomatic APIs
- Standard library docs
- Rust Playground: run snippets in the browser