Backend development

Stage 1 · Lesson 5 of 10

Cargo, crates and modules

Your language and how HTTP works

is Rust's build tool and package manager in one. cargo new creates a project, cargo run builds and runs it, and cargo test runs the tests. Cargo.toml lists your dependencies, which are from crates.io, the public registry.

Many crates have optional features you switch on, such as full for . Cargo.lock pins every exact version, so commit it for a service. Inside a crate, you split code into with mod, and names stay private unless you mark them pub.

Learn cargo fmt for formatting, cargo clippy for lints and cargo doc --open to read the docs of every offline.

Common trapadding a crate for every small job; each one adds compile time and code you now have to trust, so check how well it is maintained first.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • BookFree
    The Rust Programming Language

    The Rust Project · Beginner

    The official book, free online: read ownership, enums, error handling and traits slowly

  • GuideFree
    Tokio Tutorial

    Tokio · Intermediate

    The official Tokio tutorial: tasks, shared state, channels and the async model Axum runs on

Practise

  • Small exercises that follow the book chapter by chapter, checked in your terminal

  • Your language track: small exercises with free mentor feedback on idiomatic code

Keep handy

  • Runnable examples to look up while you write: traits, generics, errors and Cargo

  • Read the HTTP overview, methods, headers and status code pages until they feel obvious

Also worth your time

Mark this stage as not done?