Files

33 lines
3.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Rust Resources
## Knowledge
- [Book: _The Rust Programming Language_ (official)](https://doc.rust-lang.org/stable/book/)
Primary source for all fundamentals lessons (ch1–9 and beyond). Use for: syntax, ownership rules, canonical examples.
- [Rust by Example](https://doc.rust-lang.org/rust-by-example/)
Terse, runnable code samples per concept, no prose. Use for: quick syntax lookup without re-reading the book.
- [std library docs](https://doc.rust-lang.org/std/)
Use for: exact method signatures (`Vec`, `HashMap`, `Result`, `Option`, …) when writing real code.
- [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/)
Use for: idiomatic backend/library code once past fundamentals (naming, error types, trait design). Specifically [C-GOOD-ERR](https://rust-lang.github.io/api-guidelines/interoperability.html#error-types-are-meaningful-and-well-behaved-c-good-err) — the checklist a reviewer applies to an error type: implement `Error`, be `Send + Sync`, never use `()`, and keep `Display` messages lowercase without trailing punctuation. Quoted verbatim in lesson 0006.
- [std: `std::error::Error`](https://doc.rust-lang.org/std/error/trait.Error.html)
Two screens, and it is the definition of what an error *is*: the `Debug + Display` supertraits, plus `source()` for a wrapped cause. States the rule that a cause belongs in *either* `source()` or `Display`, never both.
- [Book table of contents (`SUMMARY.md`)](https://github.com/rust-lang/book/blob/main/src/SUMMARY.md)
The authoritative chapter list. Use for: checking coverage claims against the real book instead of memory — `reference/book-coverage.html` is built from it.
- [std: `std::str::FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html)
One screen, and it is what `.parse()` calls. Use for: the associated-type pattern (`type Err`) and the `Point` example, which is the same shape as `Task` in 0007.
- [std: `std::fs`](https://doc.rust-lang.org/std/fs/) and [`std::io::ErrorKind`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html)
Use for: exact signatures of `read_to_string`/`write`, and the list of io failure kinds you can match on. `ErrorKind::NotFound` is the one that means "first run", not "broken".
- [Book ch12 — An I/O Project](https://doc.rust-lang.org/stable/book/ch12-00-an-io-project.html)
Primary source for lesson 0007: files, stderr, and `env::var`. 12.2 and 12.5 are the two sections that matter.
### Gaps
- No curated async/backend-framework resource yet (axum/tokio). Add once lessons reach networking — a `trpl` dependency already sits unused in `get-dependecies/`, signaling this is coming.
- Deliberately deferred, not missing: [`thiserror`](https://docs.rs/thiserror) (derives the `Display`/`From` code written by hand in 0006) and [`anyhow`](https://docs.rs/anyhow) (application-level `Box<dyn Error>` with context). Both are what real crates use; neither teaches what the trait does. Reach for them on the second real project.
## Wisdom (Communities)
- [r/rust](https://reddit.com/r/rust) — active, well-moderated. Use for: code review requests, "is this idiomatic?" checks.
- [users.rust-lang.org](https://users.rust-lang.org) — official user forum. Use for: "why won't this compile" borrow-checker questions, and the **Code Review** category. First concrete ask, set after 0006: post `tasks/src/error.rs` and ask whether one enum for both parse and store failures is right, or whether those should be two types with a wrapping variant.
- [This Week in Rust](https://this-week-in-rust.org) — weekly newsletter. Use for: staying current once past fundamentals.