Learning roadmap · 5 stages · about 42 h · up to Gold

Zero to Rust, coming from Python

Five stages from a first compiled program to a tested command-line tool, built around the one idea Python does not have: ownership.

Goal Write a small command-line tool in Rust without following a guide.

Links opened on 13 Nov 2026 · 24 sources: 24 opened and kept

  • For self-study
  • Starts from a neighbouring field
  • 5 h a week
  • Start 16 Nov 2026
  • Goal date 14 Feb 2027
5 stages over about 42 h, climbing from Bronze to Gold. Times are estimates.

Stage 1 of 5

First binary

Bronze · about 5.5 h · 87% hands-on

Install the toolchain, compile, and read your first compiler errors.

  1. Step 1 of 3

    Install and run

    about 45 min · 35 min of it hands-on

    After this step you have a compiler and cargo, and you have seen a program build and run.

    Sources

    • Main source · Documentation

      Install Rust · Rust project

      The official install page. It installs through rustup, which also brings cargo.

      Free · about 10 min · opened 13 Nov 2026

    Do

    Install with rustup, run cargo new hello, then cargo run. Read the three lines cargo prints.

    Key points

    • rustup installs the compiler and cargo together; rustc compiles one file, cargo builds whole projects.
    • cargo new makes a project, cargo run builds and runs it, cargo check only checks that it compiles.
  2. Step 2 of 3

    One whole program

    about 2 h · 1.5 h of it hands-on

    A complete program before any theory: input, a loop, match, one external crate.

    Before you open a source

    Python lets you rebind any name. What will the Rust compiler say to: let x = 5; x = 6;

    Sources

    Do

    Type the guessing game yourself, no pasting. Then break it on purpose: remove one mut and read the error.

    Check yourself

    1. let x = 5; x = 6; What happens?

      • It runs and x is 6
      • It does not compile
      • It compiles and fails at run time
      Show the answer

      Variables are immutable unless declared with let mut. The compiler rejects the second assignment.

    Key points

    • Variables are immutable by default; add mut to allow reassignment.
    • match compares a value against patterns and must cover every case.
    • External crates (the guide uses rand) are listed in Cargo.toml and cargo downloads them.
    • A compiler error names the line, says what is wrong and often suggests a fix.
  3. Step 3 of 3

    Fix twenty small programs

    about 2.5 h · 2.5 h of it hands-on

    Short broken programs to repair. This is where reading compiler errors becomes routine.

    Sources

    • Main source · Exercises

      Rustlings · Rust project

      Small exercises for reading and writing Rust. The project itself recommends them alongside the book.

      Free · opened 13 Nov 2026

    Do

    Work through the first Rustlings exercise groups until every one compiles.

    Key points

    • Read the compiler error from the top before changing code; it usually points at the exact fix.
    • Fix Rustlings exercises one at a time until each one compiles and passes.

Signpost at the end of the stage

Base camp

Show, test or explain each of these. Tick 2 of 2 to pass.

What you can show

  • Show a project you created with cargo that builds without warnings.
  • Show one compiler error you caused on purpose and explain each line of it.

Camp

Build the guided tool

about 1.5 h · Part of the capstone

Follow the guide once, typing everything.

Rungs of the ladder

Climb the ladder: first with the guide, then changed, then your own.

  1. Guided Build grrs along the tutorial and run it on a file of your own.

For this camp

Stage 2 of 5

Ownership and borrowing

Silver · about 8.5 h · 82% hands-on

The one idea Python does not have. Everything later depends on it.

  1. Step 1 of 4

    Who owns the value

    about 2.5 h · 1.5 h of it hands-on

    In Python two names can share one object. Here a value has one owner, and assignment can move it.

    Before you open a source

    let a = String::from("hi"); let b = a; println!("{a}"); Does this compile?

    Sources

    Do

    Write the three lines, read the error, then make it compile in two different ways.

    Check yourself

    1. The same three lines with let a = 5 compile. Why?

      Show the answer

      An integer is copied on assignment, so a stays valid. A String is moved, so a is no longer usable.

    Key points

    • Each value has exactly one owner, and the value is dropped when its owner goes out of scope.
    • Assigning a String to another variable moves it; the old variable can no longer be used.
    • Integers and other simple types are copied on assignment, so both variables stay valid.
    • clone makes a real copy when you need both; it costs time and memory.
  2. Step 2 of 4

    Lend, do not give away

    about 2 h · 1.5 h of it hands-on

    References let a function use a value without taking it. The compiler allows one writer or many readers, never both.

    Before you open a source

    A function takes &String and tries to push to it. Does it compile, and what would change that?

    Sources

    Do

    Write one function that reads a String through a reference and one that changes it through a mutable reference. Call each twice from main.

    Check yourself

    1. Why can you not hold two mutable references to the same String at once?

      Show the answer

      Two writers could change the value under each other. The compiler refuses it at build time, so no data race can happen.

    Key points

    • &T lends read-only access, &mut T lends write access, and the owner keeps the value.
    • At one time you may have many shared references or one mutable reference, never both.
    • A reference must not outlive the value it points to; the compiler checks this.
  3. Step 3 of 4Side trail

    Borrowing, by example

    about 1 h · 50 min of it hands-on

    A side trail: short examples of lending a value instead of giving it away.

    Sources

    • Main source · Documentation

      Rust By Example: Borrowing · Rust project

      Short code examples of borrowing to change and run again.

      Free · about 20 min · opened 13 Nov 2026

    Do

    Run each example, change one line so it fails, and predict the error before you compile.

    Key points

    • Pass &value to lend and &mut value to lend for changes; the function does not take ownership.
    • Borrowing does not move a value: the owner can use it again once the borrow is over.
  4. Step 4 of 4

    Move and borrow, twenty times

    about 3 h · 3 h of it hands-on

    Repetition is how ownership stops feeling like a rule and starts feeling like a habit.

    Sources

    • Main source · Exercises

      Rustlings · Rust project

      Small exercises for reading and writing Rust. The project itself recommends them alongside the book.

      Free · opened 13 Nov 2026

    Do

    Continue Rustlings with the exercises that deal with moving and borrowing values. Fix each one without looking up the answer first.

    Key points

    • On a moved-value error, either borrow with & or clone, depending on whether the caller still needs the value.
    • A function that only reads its argument should take a reference, so the caller keeps ownership.

Signpost at the end of the stage

Ownership ridge

Show, test or explain each of these. Tick 2 of 2 to pass.

What you can show

  • Show a function that borrows a String and one that takes ownership, and say which one the caller can still use afterwards.
  • Explain a moved-value error to someone who only knows Python.

Camp

Change the tool, then build your own

about 4 h · Part of the capstone

Same tool, new behaviour, then a tool you pick.

Rungs of the ladder

Climb the ladder: first with the guide, then changed, then your own.

  1. Changed Add an option that prints the line number in front of every match.
  2. Your own Build a different tool from the menu, without a guide.

Pick one

  • Word counter for text files
  • Sum one column of a CSV file
  • Batch file renamer

It is done when

  • Builds without warnings
  • Handles a missing file without a panic
  • You can explain every borrow in it

Stage 3 of 5

Structs, enums and errors

Silver · about 9.5 h · 79% hands-on

Model your data with types, and handle failure with values instead of exceptions.

  1. Step 1 of 4

    Your own types

    about 2 h · 1.5 h of it hands-on

    A struct is a Python class without inheritance. Methods live in a separate impl block.

    Before you open a source

    A Python class bundles data and methods in one block. Where do you think a Rust struct keeps its methods?

    Sources

    Do

    Define a struct for one line of your tool's output, write a constructor function and one method, and print an instance.

    Key points

    • A struct groups named fields; its methods go in a separate impl block, not inside the struct.
    • Field init shorthand lets you write name instead of name: name when the variable has the same name.
    • Struct update syntax (..other) fills the remaining fields from another instance.
    • mut applies to the whole instance, not to single fields.
  2. Step 2 of 4

    Enums and match

    about 2 h · 1.5 h of it hands-on

    An enum can carry data in each variant. Option replaces None, and match makes you handle every case.

    Before you open a source

    Python returns None when nothing is found. What would a function that may find nothing return in Rust?

    Sources

    Do

    Write an enum with three variants that carry different data, and a match that handles each. Then delete one arm and read the error.

    Check yourself

    1. What does the compiler do when a match leaves out one variant of an enum?

      • Runs the other arms and ignores it
      • Refuses to compile
      • Panics at run time
      Show the answer

      A match must cover every variant. A missing one is a compile error, which is the point of enums.

    Key points

    • An enum value is exactly one variant, and each variant can carry its own data.
    • Option<T> replaces null: a value is Some(x) or None, and you must handle both.
    • match must cover every variant; use _ as a catch-all only when you mean it.
  3. Step 3 of 4

    Result instead of exceptions

    about 2.5 h · 2 h of it hands-on

    Failure is a value you return. The question mark passes it up, and unwrap is only for code that cannot fail.

    Before you open a source

    Python raises an exception when a file is missing. How could a function report that without raising?

    Sources

    Do

    Make your tool return a Result when the file is missing, pass it up with the question mark, and print a readable message in main.

    Check yourself

    1. Name one place where unwrap is fine and one where it is not.

      Show the answer

      Fine in a quick test or when a failure is truly impossible. Not in code that reads user input or files, because a failure would crash the program.

    Key points

    • Result<T, E> is Ok(value) or Err(error); the caller decides what to do with each.
    • The ? operator returns the error early, so it only works in a function that returns a compatible Result.
    • unwrap and expect panic on Err; keep them for tests, examples and cases that cannot fail.
    • The anyhow crate adds context to errors, for example .with_context(...), for readable messages in a CLI.
  4. Step 4 of 4

    Types and errors, in small tasks

    about 3 h · 3 h of it hands-on

    Three small exercises that each need a struct, an enum or a Result.

    Sources

    • Main source · Exercises

      Rust on Exercism · Exercism

      Practice exercises with community solutions to read afterwards. The site says it is free for everyone.

      Free · opened 13 Nov 2026

    Do

    Solve three exercises on the Rust track, choosing ones that use a struct, an enum and a Result. Read one community solution for each afterwards.

    Key points

    • Start from the types: a struct for related fields, an enum for one-of-several cases, Result for what can fail.
    • Read other solutions after yours and compare how they used match, ? and iterators.

Signpost at the end of the stage

Types camp

Show, test or explain each of these. Tick 2 of 3 to pass.

What you can show

  • Show a function that returns a Result and a caller that handles both outcomes.
  • Show an enum with data in its variants and a match over it with no catch-all arm.
  • Explain in one sentence why Rust has no null.

Camp

Report errors properly

about 2 h · Part of the capstone

The tool from the last camp should never panic on bad input.

Rungs of the ladder

Climb the ladder: first with the guide, then changed, then your own.

  1. Changed Give your tool its own error type and an exit code that differs for a missing file and an unreadable one.

Stage 4 of 5

Collections, traits and lifetimes

Gold · about 11 h · 82% hands-on

Store many values, share behaviour between types, and read lifetime annotations without fear.

  1. Step 1 of 4

    Vectors and hash maps

    about 2 h · 1.5 h of it hands-on

    Vec is the list you know, HashMap the dict. Both own what they hold, so ownership comes along.

    Before you open a source

    In Python you can append to a list while looping over it. What will the borrow checker say to that in Rust?

    Sources

    Do

    Count word frequencies in a text file with a HashMap, then sort the result into a Vec and print the top five.

    Key points

    • Vec<T> is a growable list. v[i] panics when i is out of range; v.get(i) returns an Option instead.
    • You cannot push to a Vec while holding a reference to one of its elements; the push may move the data.
    • HashMap<K, V> takes ownership of inserted keys and values that are not Copy.
    • map.entry(key).or_insert(0) is the usual way to update a count without overwriting it.
  2. Step 2 of 4

    Traits: shared behaviour

    about 2.5 h · 2 h of it hands-on

    A trait is like an abstract base class or a protocol: a list of methods a type promises to have.

    Before you open a source

    How does Python decide that an object can be used as an iterable? What do you expect Rust to ask for instead?

    Sources

    Do

    Define a trait with one method, implement it for two of your own types, and write one function that accepts any type with that trait.

    Check yourself

    1. What must a type do before it can be passed to a function that asks for T: MyTrait?

      Show the answer

      It must implement MyTrait, in an impl MyTrait for Type block.

    Key points

    • A trait lists method signatures; a type opts in with impl Trait for Type.
    • A function can take impl Trait or a generic T: Trait, so it works for any type that implements it.
    • Traits can have default methods that an implementing type may keep or override.
    • You may implement a trait for a type only if the trait or the type is defined in your own crate (the orphan rule).
  3. Step 3 of 4

    Lifetimes, read slowly

    about 2.5 h · 1.5 h of it hands-on

    Lifetime annotations do not change how long anything lives. They tell the compiler how references relate.

    Before you open a source

    A function returns one of two string references. How does the compiler know the result does not outlive either input?

    Sources

    Do

    Write the longest function from the chapter without looking, trigger the missing lifetime error, then fix it with an annotation.

    Check yourself

    1. Does writing 'a on a reference make the value live longer?

      Show the answer

      No. The annotation only describes how the lifetimes of references relate, so the compiler can check them.

    Key points

    • A lifetime annotation like 'a does not extend a lifetime; it states how the lifetimes of references relate.
    • A function that returns a reference must tie it to an input, or the compiler cannot prove the result stays valid.
    • Most signatures need no annotations, because of the lifetime elision rules.
    • A struct that holds a reference needs a lifetime parameter so it cannot outlive what it borrows.
  4. Step 4 of 4

    Collections and traits, in small tasks

    about 4 h · 4 h of it hands-on

    Exercises where the type system does half the work once you pick the right types.

    Sources

    • Main source · Exercises

      Rust on Exercism · Exercism

      Practice exercises with community solutions to read afterwards. The site says it is free for everyone.

      Free · opened 13 Nov 2026

    • Alternative · Exercises

      Rustlings · Rust project

      Small exercises for reading and writing Rust. The project itself recommends them alongside the book.

      Free · opened 13 Nov 2026

    Do

    Solve three exercises that need a Vec or a HashMap and one that needs you to implement a trait. Refactor one earlier solution to use what you learned.

    Key points

    • Pick the collection by access pattern: Vec for order and index, HashMap for lookup by key.
    • When a function needs behaviour rather than a concrete type, ask for a trait bound.

Signpost at the end of the stage

Trait pass

Show, test or explain each of these. Tick 2 of 3 to pass.

What you can show

  • Show a function that works for two different types through a trait.
  • Show a struct that holds a reference, with its lifetime annotation, and say what it prevents.
  • Explain when you would pick a HashMap over a Vec.

Stage 5 of 5

Finish the tool

Gold · about 7.5 h · 71% hands-on

Split the code into modules, test it, use iterators, and ship a tool you chose yourself.

  1. Step 1 of 4

    Modules and crates

    about 1.5 h · 1 h of it hands-on

    Split a growing program into files and modules, and pull in a crate for argument parsing.

    Sources

    Do

    Move your tool's logic out of main into a library part with at least two modules, keep main thin, and add one dependency to Cargo.toml.

    Key points

    • A package holds crates; a crate is a tree of modules rooted at main.rs (binary) or lib.rs (library).
    • Items are private by default; mark them pub to use them from outside their module.
    • Dependencies go under [dependencies] in Cargo.toml, and cargo fetches them on the next build.
    • Keep main thin: parse arguments, call a library function, and handle the Result it returns.
  2. Step 2 of 4

    Tests you can trust

    about 2 h · 1.5 h of it hands-on

    Unit tests live next to the code, and cargo test runs them all. Test the failure paths too.

    Before you open a source

    Where would you put the tests for a function in a Python project? Where do you expect Rust to put them?

    Sources

    Do

    Write at least five tests for your tool: three for normal input and two for failures. Make one fail on purpose and read the output.

    Check yourself

    1. Which macro compares two values in a test and shows both when they differ?

      • assert!
      • assert_eq!
      • panic!
      Show the answer

      assert_eq! prints the left and right value when they differ. assert! only prints the expression.

    Key points

    • A test is a function marked #[test]; cargo test runs all of them and reports each as ok or FAILED.
    • assert_eq!(left, right) prints both values when they differ; assert! only reports the failed expression.
    • Unit tests live in a #[cfg(test)] module in the same file; integration tests live in a tests directory.
    • #[should_panic] checks that code panics on bad input; a test can also return a Result.
  3. Step 3 of 4

    Iterators

    about 2.5 h · 2 h of it hands-on

    Iterator chains are Rust's list comprehensions: lazy, fast, and checked by the compiler.

    Before you open a source

    Python's map and filter are lazy. What do you expect Rust to need before an iterator chain produces a value?

    Sources

    Do

    Rewrite one loop in your tool as an iterator chain with map, filter and collect, and check that the output is unchanged.

    Key points

    • Iterators are lazy: map and filter do nothing until a consuming method such as collect, sum or a for loop runs them.
    • iter() borrows the items, into_iter() takes ownership of them, iter_mut() borrows them mutably.
    • collect needs a target type, for example let v: Vec<_> = ... or collect::<Vec<_>>().
  4. Step 4 of 4Side trail

    Read someone else's Rust

    about 1.5 h · 1 h of it hands-on

    Reading a small, well-made crate shows how the pieces you learned fit together outside of exercises.

    Sources

    No checked source

    No source could be verified for this step. Search terms that should find one: "small Rust crates to read for beginners", "Rust code reading guide".

    Do

    Pick a small crate you use, read its main module and tests, and write down three things it does that you would have done differently.

    Key points

    • Read the tests first: they show what the crate promises and how its functions are meant to be called.
    • Start at lib.rs or main.rs and follow one public function down to where it does its work.

Signpost at the end of the stage

Summit camp

Show, test or explain each of these. Tick 3 of 3 to pass.

What you can show

  • Run cargo test on your own tool and show that every test passes.
  • Show your tool handling a missing file, a bad option and an empty input without a panic.
  • Explain to someone else why you chose the types you did.

Camp

Ship your own tool

about 5 h · Part of the capstone

A tool you chose, tested, with a readable command line.

Rungs of the ladder

Climb the ladder: first with the guide, then changed, then your own.

  1. Your own Finish the tool you started at the ownership camp: tests, error handling and a help text, with no guide open.

It is done when

  • Builds without warnings
  • At least five passing tests
  • Never panics on bad input
  • You can explain every borrow in it

For this camp

Capstone

A command-line tool of your own

One tool that grows at every camp: first built along a guide, then changed, then replaced by one you chose.

The camps of every stage build up to this.

This outline and the map are the same roadmap: progress made in one shows in the other.

Times are estimates.