Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 132 ยท Getting Started

Rust Learning Roadmap and Popular Crates

A practical Rust learning path from basics to async and unsafe, plus a tour of the crates you will meet (serde, tokio, clap, rand, anyhow, rayon, reqwest) and notes on Rust careers.

Rust has a reputation for being hard, and the reputation is half deserved. The first few weeks are steep because ownership is a new idea. After that, the language is consistent, and most of what you learn keeps paying off. The trick is to learn things in a sensible order, and to know which libraries ("crates") the community expects you to reach for.

This lesson gives you both: a study path through this tutorial and beyond, and a map of the most popular crates. The crate overviews are read-only because the in-browser runner has no access to the crate registry; each is followed by a runnable, standard-library-only stand-in that shows the idea. If you want the longer story of why you might pick Rust at all, read Rust compared with C++, Go and Python first.

A study path

You do not have to follow this exactly, but each stage assumes the one before it.

  1. Basics (weeks 1-2). Variables, types, control flow, functions, printing. Goal: write small programs without fighting the compiler's syntax.
  2. Ownership (weeks 2-4). Ownership, borrowing, slices, lifetimes. This is the hard part. Do the practice problems and read every compiler message to the end; they are unusually helpful.
  3. Data modeling (weeks 4-6). Structs, enums, pattern matching, traits, generics, error handling and collections with iterators.
  4. A first real project. Build a command-line tool or the todo app. Projects teach what lessons cannot: how the pieces fit.
  5. Smart pointers and concurrency. Rc and Arc, threads, channels, Mutex.
  6. Async and the ecosystem. Async Rust and Tokio, then a web service.
  7. Specializations. Pick what you need: unsafe and FFI, embedded and WebAssembly, macros, performance.

The Rust learning path

Basics Syntax and types
Ownership Borrowing and lifetimes
Modeling Structs, enums, traits
Projects Build real tools

Stay at ownership until the compiler stops surprising you.

1 / 2

When you get stuck, shrink the problem. Copy the failing code into a new file, remove everything not needed to see the error, and read the message again. Most ownership errors become obvious at ten lines.

Rust's standard library is deliberately small. Many things other languages build in come from crates, added with cargo add (Crates and Dependencies). These are the names you will see everywhere:

Need Crate What it does
Serialization serde (+ serde_json, toml) turn structs into JSON/TOML/other formats and back
Async runtime tokio tasks, timers, networking
HTTP server axum, actix-web web frameworks
HTTP client reqwest calls web APIs
Command line clap argument parsing, help text, subcommands
Errors anyhow, thiserror easy application errors / derived library errors
Randomness rand random numbers and sampling
Parallel loops rayon turn iter() into par_iter()
Dates chrono, time calendar dates and time zones
Logging tracing, log structured logs
Regular expressions regex fast, safe pattern matching
Databases sqlx, diesel SQL access
Testing proptest, criterion property tests and benchmarks

Here is what some of them look like in real projects. This code needs those crates and so is read-only:

Rust
// Cargo.toml: serde = { version = "1", features = ["derive"] }, serde_json = "1"
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
struct User {
    name: String,
    age: u8,
}

fn main() -> anyhow::Result<()> {
    let user: User = serde_json::from_str(r#"{"name":"Ada","age":36}"#)?;
    println!("{}", serde_json::to_string(&user)?);
    Ok(())
}
Rust
// Cargo.toml: rayon = "1"
use rayon::prelude::*;

fn main() {
    let total: u64 = (1..=1_000_000u64).into_par_iter().map(|n| n * n % 7).sum();
    println!("{total}");
}

Two things stand out. First, #[derive(Serialize, Deserialize)] uses the procedural macros you will learn later to write the conversion code for you. Second, rayon's change is a single method name, because iterators and ownership already tell the library what is safe to run in parallel.

Runnable stand-ins

You can get the flavor of clap and rayon with the standard library alone. First a tiny flag parser, the kind clap replaces with a derive attribute:

Rust A hand-written flag parser (what clap automates)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with io::stdin().read_line()), it gets the next line from this box.

And a scoped-thread sum, which does by hand what rayon::par_iter().sum() does for you:

Rust Parallel sum with std threads (what rayon automates)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with io::stdin().read_line()), it gets the next line from this box.

The libraries are not magic: they package patterns you could write yourself, with better error messages, more features and years of testing.

Choosing crates wisely

  • Prefer the standard library when it is enough. Every dependency is code you must trust and keep updated.
  • Check maintenance. Look at recent releases, open issues and download counts on crates.io, and read the documentation on docs.rs.
  • Run cargo audit (a separate tool) to check for known security advisories, and commit Cargo.lock for applications.
  • Mind compile times. Big dependency trees slow clean builds; disable default features you do not need (Cargo features).

Career notes

Rust jobs exist in infrastructure, security, networking, databases, blockchain, game tooling, embedded and developer tools, and many teams add Rust gradually next to existing C, C++, Go or Python code. Employers rarely expect years of Rust; they look for solid fundamentals, comfort with ownership and traits, and a project you can explain. A good portfolio is two or three small but finished tools or services, with tests, documentation and a clear README. Contributing a small fix to an open-source crate is excellent practice at reading other people's Rust.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which topic should you master before moving on to async Rust?

    Async code is built on ownership, lifetimes and traits. Without a solid grip on them, async errors are very hard to read.
  2. 2. Which crate is the usual choice for turning structs into JSON?

    serde defines the Serialize and Deserialize traits; serde_json provides the JSON format.
  3. 3. What does rayon change in a program?

    Replacing iter() with par_iter() splits the work across a thread pool.
  4. 4. Why prefer the standard library when it is enough?

    Dependencies are a cost in security, maintenance and build time, so add them when they earn their place.

Summary

  • Learn in order: basics, ownership, data modeling, a first project, concurrency, async, then a specialty.
  • The standard library is small by design; crates fill the gaps (serde, tokio, clap, rand, anyhow, rayon, reqwest).
  • Crate code is shown read-only here, with std-only stand-ins that run in the browser.
  • Choose dependencies carefully: check maintenance, features and security advisories.
  • Small, finished projects with tests are the best learning tool and portfolio.

Next: Variables and Mutability starts the next chapter.