How to Read the Examples
Every finished chapter should contain:
- a concrete consumer goal;
- a complete program visible by default;
- observed stdout as if the reader ran it;
- a timeline when ordering materially aids understanding;
- the public contract (
Future,Send, ownership, cancellation safety); - one changed input or failure case;
- only the source needed to explain visible behavior.
Do not require the reader to run code. Programs should remain runnable so the book can verify its claims, but commands belong in contributor documentation, not in the teaching flow.
Provider-source excerpts may eventually be folded. Consumer programs and their output should remain visible.
Distinctions to preserve
async fndoes not start a background thread.- Calling an async function creates a future; polling drives it.
.awaitsuspends the current task, not necessarily the operating-system thread.- Concurrent work is not automatically parallel work.
spawnchanges ownership and lifetime requirements.- Dropping a future is the ordinary cancellation mechanism, but cancellation safety depends on the operation.
- Blocking work inside an async task can block an executor worker.
Evidence convention
Pin Rust and dependency versions before claiming exact diagnostics or runtime formatting. Timing examples should explain ordering relationships without depending on exact millisecond measurements.