Stage 1 · Lesson 5 of 10
Cargo, crates and modules
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
- BookFreeThe Rust Programming Language
The Rust Project · Beginner
The official book, free online: read ownership, enums, error handling and traits slowly
- GuideFreeTokio Tutorial
Tokio · Intermediate
The official Tokio tutorial: tasks, shared state, channels and the async model Axum runs on
Practise
Keep handy
Also worth your time
The DNS, TCP, TLS and HTTP steps behind every request your backend will handle