Overview
4 min read
Coming from Node, you lean on npm: Express for web, axios for HTTP, winston for logs, date-fns for dates, lodash for utilities, and a hundred small packages besides. Rust ships a deliberately small standard library and leans on a tight set of community crates that have become near-universal. This section is a guided tour of that ecosystem for a Node developer — the headline crates and the npm packages they replace, the web frameworks and async runtimes, logging and structured tracing, documentation, HTTP clients, date/time, regular expressions, and real parsing — so you know what to install and why on day one.
What You’ll Learn
Section titled “What You’ll Learn”- The most-used crates and the npm packages they replace (serde, tokio, clap, reqwest, anyhow/thiserror, …)
- The web framework landscape — Axum, Actix Web, Rocket, Poem — and which fits which job
- Why Tokio dominates the async-runtime space, and where async-std and smol fit
console.log→ thelogfacade +env_logger: levels, targets, and the facade/implementation split- Structured logging with
tracingandtracing-subscriber: spans,#[instrument], and JSON logs - JSDoc → rustdoc: doc comments, intra-doc links, examples-as-tests, and publishing to docs.rs
- axios/fetch → reqwest (and where hyper fits): JSON GET/POST, headers, and reusing a client
Date→ chrono and the time crate: parsing, formatting, time zones, and durations- Regular expressions with the regex crate: compile-once, captures, and the no-backtracking guarantee
- Parser combinators with nom and pest, and when to reach for a real parser over a regex
- A grab-bag of other essentials: itertools, rayon, once_cell/LazyLock, uuid, indexmap, bytes, dashmap
Topics
Section titled “Topics”| Topic | Description |
|---|---|
| Popular Crates | The most-used crates and the npm packages they replace (serde, tokio, clap, reqwest, anyhow, …). |
| Web Frameworks | The web framework ecosystem — Axum, Actix Web, Rocket, Poem — their maturity and fit. |
| Async Runtimes | Tokio vs async-std vs smol, and why Tokio has become the ecosystem default. |
| Logging | console.log → the log facade + env_logger: levels, targets, and the facade/implementation split. |
| Tracing | Structured logging and spans with tracing + tracing-subscriber: #[instrument] and JSON logs. |
| Documentation | JSDoc → rustdoc: doc comments, intra-doc links, examples-as-tests, and publishing to docs.rs. |
| HTTP Clients | axios/fetch → reqwest (and a note on hyper): JSON GET/POST, headers, and async client reuse. |
| Date and Time | Date → chrono and the time crate: parsing/formatting, time zones, and durations. |
| Regular Expressions | The regex crate: compile-once, captures, and the linear-time no-backtracking guarantee. |
| Parsing | Parser combinators with nom and pest, and when to reach for a real parser over a regex. |
| Useful Crates | Other essentials: itertools, rayon, once_cell/LazyLock, uuid, indexmap, bytes, dashmap. |
Learning Objectives
Section titled “Learning Objectives”By the end of this section, you will be able to:
- Map the npm packages you already use onto their Rust crate equivalents and reach for the right one immediately
- Choose a web framework and an async runtime with the same confidence you choose Express vs NestJS
- Add leveled logging with
log+env_logger, then graduate to span-based structuredtracingwhen a service needs it - Document a crate with rustdoc, write examples that double as tests, and understand what docs.rs publishes for free
- Call HTTP APIs with a reusable reqwest client, and parse and format dates and durations with chrono or the time crate
- Decide between a regex, a
serdedeserializer, and a real parser (nom/pest) for a given input - Round out a project with the second-tier utility crates that fill the gaps Node hides inside the language
Prerequisites
Section titled “Prerequisites”- Section 12: Modules & Packages — the ecosystem is delivered as crates, so the
Cargo.toml,cargo add, and dependency model comes first.
Note: Several pages link out to the deeper, hands-on guides where a topic gets full treatment: async mechanics live in Section 11: Async, and the build-oriented Axum walkthrough lives in Section 16: Web APIs. The pages here stay at survey altitude — what each crate is, why it won, and when to reach for it.
Estimated Time
Section titled “Estimated Time”- Reading: 5 hours
- Hands-on Practice: 3 hours
- Exercises: 2 hours
- Total: 10 hours
Tip: You do not need to read these pages in order. Skim Popular Crates first to build a mental map, then dive into whichever crate your current project needs.
Next: Section 24: Tooling → — Cargo beyond the basics, rustfmt and Clippy, debugging, rust-analyzer, CI/CD, Docker, and the cargo plugins worth installing.