101 terms from the curriculum. Each entry shows the term in both languages and links to the lesson that introduces it.
Iterator::Item.Lesson: Advanced traits →async fn returns a future.Lesson: Async and await →AtomicUsize whose operations happen indivisibly, so threads can share it without a lock.Lesson: Atomics and memory ordering →let. Bindings are immutable unless declared with let mut.Lesson: Variables and types →.clone().Lesson: Ownership →|x| x + offset.Lesson: Closures and iterators →[T; N].Lesson: Type-level programming →bool.Lesson: Ownership →macro_rules! that matches patterns of tokens and expands them into code.Lesson: Declarative macros →#[derive(…)] attribute, which generates a standard trait implementation such as Debug or Clone for a type.Lesson: Traits →/// documentation comment that cargo test compiles and runs.Lesson: Testing and documentation →Drop trait lets a type run code at that moment.Lesson: Ownership →[T], str or dyn Trait. It can only be used behind a fat pointer.Lesson: Memory layout and representation →if, match and blocks are expressions; a trailing semicolon turns an expression into a statement.Lesson: Functions and control flow →Vec<T> or fn max<T: Ord>(…).Lesson: Generics →String or Vec.Lesson: Ownership →RefCell, Mutex) or made unnecessary (Cell, atomics).Lesson: Smart pointers and interior mutability →next(). Adapters such as map and filter are lazy.Lesson: Closures and iterators →#[repr(C)].Lesson: Memory layout and representation →&'a str relate the lifetimes of inputs and outputs; they never change how long anything lives.Lesson: Lifetimes →Relaxed, Acquire, Release, SeqCst) that says which guarantees about visibility across threads you need.Lesson: Atomics and memory ordering →impl block whose first parameter is self, &self or &mut self.Lesson: Structs and methods →mod. Modules control which items are visible from outside through pub.Lesson: Modules, crates and Cargo →Mutex<T>.Lesson: Threads and shared state →Option<&T> is the same size as &T.Lesson: Memory layout and representation →core, for targets with no operating system.Lesson: no_std and embedded Rust →Some(value) or None. Rust has no null.Lesson: Enums and pattern matching →match, if let or let else. A match must cover every case.Lesson: Enums and pattern matching →T it does not actually store.Lesson: Subtyping and variance →Pin<P> guarantees the value behind the pointer will not be moved again. Self-referential futures depend on it.Lesson: Pin and self-referential types →#[derive(…)] macros are the most common kind.Lesson: Procedural macros →*const T or *mut T: a pointer with no guarantees about validity or aliasing. Dereferencing one requires unsafe.Lesson: Unsafe Rust →&T is shared and read-only; &mut T is exclusive and writable.Lesson: References and borrowing →Rc<T> within one thread, Arc<T> across threads. The value is dropped when the count reaches zero.Lesson: Smart pointers and interior mutability →Ok(value) or Err(error).Lesson: Error handling →Send types can be moved to another thread; Sync types can be shared between threads by reference.Lesson: Threads and shared state →&[T] for arrays and vectors, &str for text.Lesson: References and borrowing →Box<T>, Rc<T> or Arc<T>.Lesson: Smart pointers and interior mutability →String is owned, growable UTF-8 text; &str is a borrowed slice of UTF-8 text.Lesson: Collections and strings →impl blocks.Lesson: Structs and methods →None) if there is one, and otherwise unwraps the value.Lesson: Error handling →std::thread::spawn.Lesson: Threads and shared state →T: Trait, that says which traits the type must implement.Lesson: Traits →dyn Trait used behind a pointer. The concrete type is erased and methods are found at run time.Lesson: Trait objects and dynamic dispatch →::<T> syntax for giving type arguments explicitly, as in "5".parse::<i32>().Lesson: Generics →unsafe code.Lesson: Unsafe Rust →#[test], usually in a #[cfg(test)] module next to the code it checks. cargo test runs them.Lesson: Testing and documentation →&'a T is covariant in 'a; &mut T is invariant in T.Lesson: Subtyping and variance →Vec<T>: a growable array stored on the heap.Lesson: Collections and strings →dyn Trait pointer carries a pointer to it.Lesson: Trait objects and dynamic dispatch →() or an empty struct. It exists only at compile time.Lesson: Memory layout and representation →