Tech Wiki

TOPICSSERIES

Rust Zero to Production: From Core Syntax to Async Web APIs

Rust Zero to Production: From Core Syntax to Async Web APIs

Move step by step from Rust syntax and ownership to a tested asynchronous web API.

Audience
Developers who know another programming language and are new to Rust
Prerequisites
Comfort with a terminal and text editor. Basic HTTP and JSON knowledge is needed before Phase 6.
Final project
An Axum Endpoint Monitor API that stores state in SQLite and runs periodic checks with bounded concurrency
Current progress
32/32 published
Last verified
2026-09-19

Start the series

Phase 1 — Core Syntax and CLI Foundations

Phase outcome: Compile, run, format, lint, and test small Rust programs; read ordinary expressions and collection code.

  1. Published
    01

    Toolchain and Cargo

    Install and verify the toolchain; build, run, format, lint, and test one crate.

  2. Published
    02

    Variables and Constants

    Explain inference, annotations, shadowing, constants, and explicit mutation.

  3. Published
    03

    Functions and Control Flow

    Build small pure functions; distinguish statements from expressions; test branches and loops.

  4. Published
    04

    Tuples, Arrays, and Destructuring

    Transform fixed-size data safely and handle indexed access without panics.

  5. Published
    05

    Vec, String, and HashMap

    Parse and summarize endpoint records with safe collection APIs and Unicode-aware string handling.

  6. Published
    06

    CLI Input and Logic Boundaries

    Produce an initial endpoint registry CLI using standard-library argument handling and unit tests.

Project milestone: A testable endpoint registry CLI

Phase 2 — Ownership and Borrowing

Phase outcome: Predict moves and borrows, choose owned versus borrowed data, and resolve routine lifetime diagnostics without trial-and-error cloning.

  1. Published
    07

    Ownership and Moves

    Predict value validity after assignment and function calls; no cargo-cult cloning.

  2. Published
    08

    References and Borrowing

    Refactor the CLI to borrow data and explain aliasing plus mutation rules.

  3. Published
    09

    Slices and Strings

    Design text-processing signatures and handle UTF-8 boundaries safely.

  4. Published
    10

    Lifetimes

    Resolve realistic borrowed-return-value diagnostics and avoid unnecessary `'static`.

  5. Published
    11

    Ownership-Driven API Design

    Refactor the endpoint model with deliberate ownership, borrowing, and conversion boundaries.

Project milestone: An endpoint model with deliberate ownership boundaries

Phase 3 — Type Abstractions and Crate Design

Phase outcome: Organize modules, model states with types, use traits and iterators, and establish error-handling and testing conventions.

  1. Published
    12

    Structs and Methods

    Introduce endpoint IDs, URLs, intervals, validation, constructors, and invariants.

  2. Published
    13

    Enums, Option, Result, and Pattern Matching

    Replace flags and sentinel values with exhaustive domain states and typed failures.

  3. Published
    14

    Generics and Traits

    Define repository and checker boundaries; compare generics, trait objects, and `impl Trait`.

  4. Published
    15

    Closures and Iterators

    Filter, transform, aggregate, and test endpoint results without unnecessary allocation.

  5. Published
    16

    Modules, Crates, and Workspaces

    Split domain, application, and adapter responsibilities into explicit module boundaries.

  6. Published
    17

    Error Handling and Testing

    Establish error context, custom errors, unit/integration boundaries, fixtures, and negative tests.

Project milestone: Domain, application, and adapter crate boundaries

Phase 4 — Smart Pointers and Concurrency

Phase outcome: Select smart pointers and synchronization tools intentionally, understand Send and Sync, and use macros without hiding program structure.

  1. Published
    18

    Smart Pointers and Ownership Graphs

    Choose pointer types from lifetime and sharing requirements; detect cycles and needless indirection.

  2. Published
    19

    Interior Mutability and Synchronization

    Separate runtime borrow checking from cross-thread synchronization and test lock-protected state.

  3. Published
    20

    Macros and Code Generation

    Write one small declarative macro, inspect expansion, and decide when a function or derive is better.

  4. Published
    21

    Threads, Send, and Sync

    Parallelize blocking checks, transfer ownership into threads, and explain marker traits through behavior.

  5. Published
    22

    Channels and Shared State

    Build a bounded worker prototype; compare message passing, locks, atomics, and shutdown behavior.

Project milestone: A bounded work queue with a tested shutdown path

Phase 5 — Async and Networking

Phase outcome: Understand futures, use Tokio tasks and channels, and design HTTP operations with cancellation, deadlines, and bounded concurrency.

  1. Published
    23

    Future, Poll, and Pin

    Trace a minimal future and explain why executors, waking, and pinning exist without implementing a runtime.

  2. Published
    24

    Tokio Tasks and async/await

    Run checks concurrently, await join results, and distinguish concurrency from parallelism.

  3. Published
    25

    Async Channels and Graceful Shutdown

    Add backpressure, coordinated shutdown, cancellation safety, and deterministic tests using paused time.

  4. Published
    26

    HTTP Timeouts, Retries, and Concurrency Limits

    Build the endpoint checker with explicit policy; avoid unbounded tasks and unsafe retry behavior.

  5. Published
    27

    Network Errors and Partial Failure

    Classify DNS, connect, TLS, status, timeout, and cancellation outcomes and expose stable domain errors.

Project milestone: A cancellable, bounded asynchronous HTTP checker

Phase 6 — Web APIs and Production

Phase outcome: Assemble the final service, persist data, operate a background worker, add observability and security controls, and verify the deployable system.

  1. Published
    28

    Axum Routing, State, and Extractors

    Expose endpoint CRUD and status routes with typed state and JSON request validation.

  2. Published
    29

    SQLx, SQLite, and Migrations

    Add schema migrations, a repository adapter, transaction boundaries, and isolated database tests.

  3. Published
    30

    APIs and Background Workers

    Connect scheduling, checking, persistence, and API state with graceful startup and shutdown.

  4. Published
    31

    Observability and API Security

    Add structured spans, request IDs, log redaction, body/time limits, health checks, and configuration validation.

  5. Published
    32

    Integration Testing and Container Deployment

    Verify API, database, worker, shutdown, and failure paths; produce a reproducible release build and runbook.

Project milestone: An integration-tested, containerized Endpoint Monitor API

Tech Wiki

Built with WordPress · Learn in public.