Summary Introduction Hello World Comments Formatted print Debug Display Testcase: List Formatting Primitives Literals and operators Tuples Arrays and Slices Custom Types Structures Enums use C-like Testcase: linked-list constants Variable Bindings Mutability Scope and Shadowing Declare first Freezing Types Casting Literals Inference Aliasing Conversion From and Into TryFrom and TryInto To and from Strings Expressions Flow of Control if/else loop Nesting and labels Returning from loops while for and range match Destructuring tuples arrays/slices enums pointers/ref structs Guards Binding if let let-else while let Functions Methods Closures Capturing As input parameters Type anonymity Input functions As output parameters Examples in std Iterator::any Searching through iterators Higher Order Functions Diverging functions Modules Visibility Struct visibility The use declaration super and self File hierarchy Crates Creating a Library Using a Library Cargo Dependencies Conventions Tests Build Scripts Attributes dead_code Crates cfg Custom Generics Functions Implementation Traits Bounds Testcase: empty bounds Multiple bounds Where clauses New Type Idiom Associated items The Problem Associated types Phantom type parameters Testcase: unit clarification Scoping rules RAII Ownership and moves Mutability Partial moves Borrowing Mutability Aliasing The ref pattern Lifetimes Explicit annotation Functions Methods Structs Traits Bounds Coercion Static Elision Traits Derive Returning Traits with dyn Operator Overloading Drop Iterators impl Trait Clone Supertraits Disambiguating overlapping traits macro_rules! Syntax Designators Overload Repeat DRY (Don't Repeat Yourself) DSL (Domain Specific Languages) Variadics Error handling panic abort & unwind Option & unwrap Unpacking options with ? Combinators: map Combinators: and_then Defaults: or, or_else, get_or_insert, 'get_or_insert_with` Result map for Result aliases for Result Early returns Introducing ? Multiple error types Pulling Results out of Options Defining an error type Boxing errors Other uses of ? Wrapping errors Iterating over Results Std library types Box, stack and heap Vectors Strings Option Result ? panic! HashMap Alternate/custom key types HashSet Rc Arc Std misc Threads Testcase: map-reduce Channels Path File I/O open create read lines Child processes Pipes Wait Filesystem Operations Program arguments Argument parsing Foreign Function Interface Testing Unit testing Documentation testing Integration testing Dev-dependencies Unsafe Operations Inline assembly Compatibility Raw identifiers Meta Documentation Playground