Skip to content

Rust / Advanced · Free public pilot

Advanced Rust in 7 Days

Design a stock ledger that bounds its input, commits complete batches and handles retries predictably.

Start your first lesson →

Build on Rust intermediate.

Come in comfortable with lifetimes, generics, traits, iterators, typed errors and injected I/O. Allow about 100–130 minutes per day for reading and practice. Split a day across sessions if you need more time.

Run Rust 2024 in your browser with code-playpad’s experimental compiler. The first Run downloads about 57 MB and caches the toolchain. Enter console input before pressing Run.

Each day ends with independent practice. Day 7 includes a multi-file project, an optional Cargo download and a review to try after a few days. Progress is saved in this browser.

Need a refresher? Review Rust Intermediate →

Day 1 · About 119 minutes

Encode Invariants in APIs

Validate newtypes, preserve typed errors and consume values through checked state transitions.

  1. Validate Values Through TryFrom 28 min · Read, predict and practice
  2. Carry Context in an Error 28 min · Read, predict and practice
  3. Consume a Draft into a Checked Value 28 min · Read, predict and practice
  4. Checkpoint: A Checked Transfer 35 min · Independent checkpoint

Day 2 · About 120 minutes

Choose Ownership and Dispatch

Use Cow, trait objects and closure bounds at deliberate API boundaries.

  1. Borrow Until Text Needs to Change 28 min · Read, predict and practice
  2. Own Interchangeable Rules with Box and dyn 30 min · Read, predict and practice
  3. Specify How a Callback May Capture State 30 min · Read, predict and practice
  4. Checkpoint: A Runtime Rule and a Reporter 32 min · Independent checkpoint

Day 3 · About 123 minutes

Process Fallible Streams

Implement an iterator, collect fallible results and bound input before parsing.

  1. Implement an Iterator with an Associated Item 30 min · Read, predict and practice
  2. Collect Results into One Result 28 min · Read, predict and practice
  3. Bound a Line Before Allocating the Whole Stream 30 min · Read, predict and practice
  4. Checkpoint: Parse One Bounded Batch 35 min · Independent checkpoint

Day 4 · About 116 minutes

Commit Batches Atomically

Check arithmetic, stage state changes and handle retries without applying work twice.

  1. Check Arithmetic Before Assigning State 28 min · Read, predict and practice
  2. Stage Changes and Commit Once 28 min · Read, predict and practice
  3. Make Repeated Requests Predictable 28 min · Read, predict and practice
  4. Checkpoint: Commit Stock and Receipt Together 32 min · Independent checkpoint

Day 5 · About 131 minutes

Expose a Reusable Library

Preserve error causes, encode deterministic snapshots and return borrowed queries.

  1. Preserve an Error’s Underlying Cause 28 min · Read, predict and practice
  2. Define a Deterministic Snapshot Format 28 min · Read, predict and practice
  3. Return a Query That Borrows Its Owner 30 min · Read, predict and practice
  4. Checkpoint: Decode, Query and Report Stock 45 min · Independent checkpoint

Day 6 · About 122 minutes

Test the Guarantees

Use a reference model, controlled mutations and injected failures to test the contract.

  1. Compare Against a Small Reference Model 30 min · Read, predict and practice
  2. Make a Plausible Regression Fail 30 min · Read, predict and practice
  3. Inject Partial Writes and Propagate Failure 30 min · Read, predict and practice
  4. Checkpoint: Observe a Commit After Output Fails 32 min · Independent checkpoint

Day 7 · About 152 minutes

Ship the Stock Ledger

Run, test and extend a transactional stock ledger, then build a reservation ledger independently.

  1. Run the Transactional Stock Ledger 26 min · Read, predict and practice
  2. Trace Validation, Ownership and Commit 28 min · Read, predict and practice
  3. Test the Ledger’s Guarantees 28 min · Read, predict and practice
  4. Add a Stock Query and Use Cargo 30 min · Read, predict and practice
  5. On Your Own: A Reservation Ledger 40 min · Independent checkpoint
  6. Come Back Later: Ownership, Atomicity and Receipts 45 min · Extra delayed review