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.
Unwrap
12.
Memory Management
❱
12.1.
Stack vs Heap
12.2.
Stack Memory
12.3.
Manual Memory Management
12.4.
Scope-Based Memory Management
12.5.
Garbage Collection
12.6.
Rust Memory Management
12.7.
Comparison
13.
Ownership
❱
13.1.
Move Semantics
13.2.
Moved Strings in Rust
13.3.
Moves in Function Calls
13.4.
Copying and Cloning
13.5.
Borrowing
❱
13.5.1.
Shared and Unique Borrows
13.6.
Lifetimes
13.7.
Lifetimes in Function Calls
13.8.
Lifetimes in Data Structures
14.
Exercises
❱
14.1.
Designing a Library
14.2.
Iterators and Ownership
Course 3
15.
Welcome
16.
Structs
❱
16.1.
Tuple Structs
16.2.
Field Shorthand Syntax
17.
Enums
❱
17.1.
Variant Payloads
17.2.
Enum Sizes
18.
Methods
❱
18.1.
Method Receiver
18.2.
Example
19.
Pattern Matching
❱
19.1.
Destructuring Enums
19.2.
Destructuring Structs
19.3.
Destructuring Arrays
19.4.
Match Guards
20.
Exercises
❱
20.1.
Health Statistics
20.2.
Points and Polygons
Course 4
21.
Welcome
22.
Control Flow
❱
22.1.
if let expressions
22.2.
while expressions
22.3.
while let expressions
22.4.
for expressions
22.5.
loop expressions
22.6.
match expressions
22.7.
break & continue
23.
Standard Library
❱
23.1.
Option and Result
23.2.
String
23.3.
Vec
23.4.
HashMap
23.5.
Box
❱
23.5.1.
Recursive Data Types
23.5.2.
Niche Optimization
23.6.
Rc
24.
Modules
❱
24.1.
Visibility
24.2.
Paths
24.3.
Filesystem Hierarchy
25.
Exercises
❱
25.1.
Luhn Algorithm
25.2.
Strings and Iterators
Course 5
26.
Welcome
27.
Traits
❱
27.1.
Deriving Traits
27.2.
Default Methods
27.3.
Important Traits
❱
27.3.1.
Iterator
27.3.2.
FromIterator
27.3.3.
From and Into
27.3.4.
Read and Write
27.3.5.
Add, Mul, ...
27.3.6.
Drop
28.
Generics
❱
28.1.
Generic Data Types
28.2.
Generic Methods
28.3.
Trait Bounds
28.4.
impl Trait
28.5.
Closures
28.6.
Monomorphization
28.7.
Trait Objects
29.
Exercises
❱
29.1.
A Simple GUI Library
Course 6
30.
Welcome
31.
Error Handling
❱
31.1.
Panics
❱
31.1.1.
Catching Stack Unwinding
31.2.
Structured Error Handling
31.3.
Propagating Errors with ?
❱
31.3.1.
Converting Error Types
❱
31.3.1.1.
Example
31.3.2.
Deriving Error Enums
31.3.3.
Dynamic Error Types
31.3.4.
Adding Context to Errors
32.
Testing
❱
32.1.
Unit Tests
32.2.
Test Modules
32.3.
Documentation Tests
32.4.
Integration Tests
33.
Unsafe Rust
❱
33.1.
Dereferencing Raw Pointers
33.2.
Mutable Static Variables
33.3.
Unions
33.4.
Calling Unsafe Functions
❱
33.4.1.
Writing Unsafe Functions
33.4.2.
Extern Functions
33.5.
Implementing Unsafe Traits
34.
Exercises
❱
34.1.
Safe FFI Wrapper
Course 7
35.
Welcome
36.
Concurrency
❱
36.1.
Threads
36.2.
Scoped Threads
36.3.
Channels
❱
36.3.1.
Unbounded Channels
36.3.2.
Bounded Channels
36.4.
Shared State
❱
36.4.1.
Arc
36.4.2.
Mutex
36.4.3.
Example
36.5.
Send and Sync
❱
36.5.1.
Send
36.5.2.
Sync
36.5.3.
Examples
37.
Exercises
❱
37.1.
Dining Philosophers
37.2.
Multi-threaded Link Checker
Light
Rust
Coal
Navy
Ayu
Rust-LINFO2315 (adapted from Comprehensive Rust 🦀)
Course 5 Exercises
We will design a classical GUI library traits and trait objects.