The course
Eleven modules, each with a local exercise, ending with evidence: code that compiles, tests that pass, and an explanation you wrote yourself.
Status
The course is in private alpha. All eleven modules and their exercises are written. The next step is testing them from the learner’s side before a public release. New articles and release news will appear in the article feed.
Foundations
- 0. Field setup: compile, test, explain Make your toolchain boring and reliable, and build the habit of changing one thing, compiling, testing and explaining.
- 1. Ownership by repair Learn moves, copies, borrows and clones by fixing concrete broken programs, and learn when a clone is reasonable and when it is surrender.
- 2. Data modelling with
OptionandResultReplace nulls, exceptions, sentinel values and stringly errors with types that state the contract. - 3. Traits, generics and boundaries Use traits to name behaviour without spreading abstraction everywhere, and keep generic APIs readable.
- 4. Iterators without mysticism Write iterator code that is clear rather than clever, and know when a
forloop is the better choice. - 5. Error handling and API design Design errors that callers can actually use.
Production track
- 6. Production CLI tools Build a small, shippable command-line tool with a thin process boundary and testable library behaviour.
- 7. CLI ergonomics with real crates Improve the tool with common crates once the architecture is understood.
- 8. Async Rust: boundaries first Treat async as a boundary and scheduling model, not as magic syntax.
- 9. Services, state and concurrency Build service-shaped Rust without reaching straight for a framework.
- 10. Reading real Rust and reviewing AI output Move from exercises to judgement: review a plausible but flawed AI-generated solution, patch it, test it and explain the review.
How you work
Each exercise is a Cargo crate with failing tests. You read the module, make one small change, and run the checks again:
cargo test -p ownership-repair
cargo clippy --workspace --all-targets -- -D warningsWhen the tests pass, you write a short explanation of the decision you made. If you cannot explain the solution, you do not own it yet.
How AI fits in
AI assistants are allowed throughout the course, with clear rules. Good uses include asking for a hint that does not give away the answer, an explanation of a compiler error in the context of your code, or a review of your explanation. Risky signs include .clone() everywhere, unwrap() used to avoid modelling failure, and lifetime annotations added before simpler ownership changes have been tried.
Every module includes a drill where you put a question to an assistant and then test its answer against the compiler, the tests and the documentation. Reviewing AI-written Rust shows the kind of thing you learn to catch.
Not a replacement for the official material
Rust Primer does not try to replace The Rust Programming Language, Rust by Example, Rustlings or the standard library documentation. Those are the authorities, and every module links back to them. Rust Primer is the practice loop around them.