Coming from other languages, what should the path laid out be for people new to Rust? This list assumes you're coming from a language like JavaScript.
This list is the list for language constructs and the std library. There are other paths for building cli tools, serverless functions, or wasm.
- What is Rust useful for and why the fuck should I learn it?
- Installing Rust with Rustup
- Hello World! Rust is a statically typed, compiled language with high-level tools (println! macro)
- Mutable and Immutable variable declaration with
let
, type inference, and snake_case.
- Primitive types: (booleans, strings, and characters)
- Overview of numbers: integers, floats, and i/usizes. integer literals.
- Compound types: tuples and structs
- functions, arguments, and return values
- Expressions vs statements
- Unit type and unit value
- Block expressions
- // comments
- /// doc comments
- Markdown
- if and else expressions
- if-let
- loop, while, break, and for
- if-let and while-let
Structs and Enums
- Classic, Tuple, and Unit structs
- Shorthand names (
Thing { name }
)
- Update syntax (..thing)
- Defaults with the Default trait
- Why Iterators?
- iterators and for loops
- Ranges
- What and Why Ownership?
- All values have a single variable owner
- When the owner goes out of scope, the value will be dropped
- Scope
- Slices
- String vs &str
- Moving owners between variables
- Moving into and out of functions
- Copy, Drop, Clone
References and Borrowing
- References vs Ownership
- Immutable and mutable references
- What's a data race and why would you want to avoid one?
- Dereferencing
- What are modules?
- Organizing a project with modules
- Using functions from another module
- Using 3rd party packages
fn thing(s: String)
vs fn thing(s: &str)
HashMaps and BTreeMaps
- What is the Entry API?
.entry
.or_insert()
.or_insert_with()
.or_insert_with_key()
.key
.and_modify
.or_default
- [nightly]
.insert