Rust Language Reference

Rust programming fundamentals. Ownership, borrowing, lifetimes, traits, error handling, and tooling.

Topics

Topic Description

Ownership

Move semantics, Copy vs Clone, scope and drop, smart pointers

Borrowing

References, mutability rules, String vs &str, slices

Lifetimes

Annotations, elision rules, structs with references, 'static

Structs

Fields, methods, impl blocks, derive, visibility

Enums & Match

Pattern matching, Option, Result, guards, destructuring

Traits

Trait bounds, standard traits, trait objects, orphan rule

Error Handling

Result, Option, the ? operator, thiserror, anyhow

Iterators

Adaptors, consumers, chains, implementing Iterator

Closures

Capture modes, Fn/FnMut/FnOnce, move closures

Cargo

Build, test, dependencies, workspaces, cross-compilation

Testing

Unit tests, integration tests, doc tests, assertions