Welcome to Comprehensive Rust 🦀
1.
Course Structure
2.
Keyboard Shortcuts
3.
Using Cargo
❱
3.1.
Rust Ecosystem
3.2.
Code Samples
3.3.
Running Cargo Locally
Course 1
4.
Welcome
❱
4.1.
What is Rust?
5.
Hello World!
❱
5.1.
Small Example
6.
Why Rust?
❱
6.1.
Compile Time Guarantees
6.2.
Runtime Guarantees
6.3.
Modern Features
7.
Basic Syntax
❱
7.1.
If expressions
7.2.
Scalar Types
7.3.
Compound Types
7.4.
References
❱
7.4.1.
Dangling References
7.5.
Slices
❱
7.5.1.
String vs str
7.6.
Functions
❱
7.6.1.
Methods
7.6.2.
Overloading
8.
Exercises
❱
8.1.
Implicit Conversions
8.2.
Matrix multiplication
8.3.
Arrays and for Loops
8.4.
Palindrome
Course 2
9.
Welcome
10.
Variables
❱
10.1.
Type Inference
10.2.
Option
10.3.
static & const
10.4.
Scopes and Shadowing
11.
Memory Management
❱
11.1.
Stack vs Heap
11.2.
Stack Memory
11.3.
Manual Memory Management
11.4.
Scope-Based Memory Management
11.5.
Garbage Collection
11.6.
Rust Memory Management
11.7.
Comparison
12.
Ownership
❱
12.1.
Move Semantics
12.2.
Moved Strings in Rust
❱
12.2.1.
Double Frees in Modern C++
12.3.
Moves in Function Calls
12.4.
Copying and Cloning
12.5.
Borrowing
❱
12.5.1.
Shared and Unique Borrows
12.6.
Lifetimes
12.7.
Lifetimes in Function Calls
12.8.
Lifetimes in Data Structures
13.
Exercises
❱
13.1.
Designing a Library
13.2.
Iterators and Ownership
Course 3
14.
Welcome
15.
Structs
❱
15.1.
Tuple Structs
15.2.
Field Shorthand Syntax
16.
Enums
❱
16.1.
Variant Payloads
16.2.
Enum Sizes
17.
Methods
❱
17.1.
Method Receiver
17.2.
Example
18.
Pattern Matching
❱
18.1.
Destructuring Enums
18.2.
Destructuring Structs
18.3.
Destructuring Arrays
18.4.
Match Guards
19.
Exercises
❱
19.1.
Health Statistics
19.2.
Points and Polygons
Course 4
20.
Welcome
21.
Control Flow
❱
21.1.
if let expressions
21.2.
while expressions
21.3.
while let expressions
21.4.
for expressions
21.5.
loop expressions
21.6.
match expressions
21.7.
break & continue
22.
Standard Library
❱
22.1.
Option and Result
22.2.
String
22.3.
Vec
22.4.
HashMap
22.5.
Box
❱
22.5.1.
Recursive Data Types
22.5.2.
Niche Optimization
22.6.
Rc
23.
Modules
❱
23.1.
Visibility
23.2.
Paths
23.3.
Filesystem Hierarchy
24.
Exercises
❱
24.1.
Luhn Algorithm
24.2.
Strings and Iterators
Course 5
25.
Welcome
26.
Traits
❱
26.1.
Deriving Traits
26.2.
Default Methods
26.3.
Important Traits
❱
26.3.1.
Iterator
26.3.2.
FromIterator
26.3.3.
From and Into
26.3.4.
Read and Write
26.3.5.
Add, Mul, ...
26.3.6.
Drop
27.
Generics
❱
27.1.
Generic Data Types
27.2.
Generic Methods
27.3.
Trait Bounds
27.4.
impl Trait
27.5.
Closures
27.6.
Monomorphization
27.7.
Trait Objects
28.
Exercises
❱
28.1.
A Simple GUI Library
Course 6
29.
Welcome
30.
Error Handling
❱
30.1.
Panics
❱
30.1.1.
Catching Stack Unwinding
30.2.
Structured Error Handling
30.3.
Propagating Errors with ?
❱
30.3.1.
Converting Error Types
❱
30.3.1.1.
Example
30.3.2.
Deriving Error Enums
30.3.3.
Dynamic Error Types
30.3.4.
Adding Context to Errors
31.
Testing
❱
31.1.
Unit Tests
31.2.
Test Modules
31.3.
Documentation Tests
31.4.
Integration Tests
32.
Unsafe Rust
❱
32.1.
Dereferencing Raw Pointers
32.2.
Mutable Static Variables
32.3.
Unions
32.4.
Calling Unsafe Functions
❱
32.4.1.
Writing Unsafe Functions
32.4.2.
Extern Functions
32.5.
Implementing Unsafe Traits
33.
Exercises
❱
33.1.
Safe FFI Wrapper
Course 7
34.
Welcome
35.
Concurrency
❱
35.1.
Threads
35.2.
Scoped Threads
35.3.
Channels
❱
35.3.1.
Unbounded Channels
35.3.2.
Bounded Channels
35.4.
Shared State
❱
35.4.1.
Arc
35.4.2.
Mutex
35.4.3.
Example
35.5.
Send and Sync
❱
35.5.1.
Send
35.5.2.
Sync
35.5.3.
Examples
36.
Exercises
❱
36.1.
Dining Philosophers
36.2.
Multi-threaded Link Checker
Light
Rust
Coal
Navy
Ayu
Rust-LINFO2315 (adapted from Comprehensive Rust 🦀)
Course 6 Exercises
Let us build a safe wrapper for reading directory content!