Velkommen til Comprehensive Rust 🦀
1.
Afvikling af kurset
❱
1.1.
Kursets struktur
1.2.
Genvejstaster
1.3.
Oversættelser
2.
Brug af Cargo
❱
2.1.
Rust's økosystem
2.2.
Kodeeksempler
2.3.
Running Cargo Locally
Dag 1: Formiddag
3.
Velkommen
4.
Hej verden!
❱
4.1.
Hvad er Rust?
4.2.
Hej verden!
4.3.
Benefits of Rust
4.4.
Playground
5.
Types and Values
❱
5.1.
Variabler
5.2.
Values
5.3.
Arithmetic
5.4.
Strings
5.5.
Typeudledning
5.6.
Exercise: Fibonacci
❱
5.6.1.
Løsninger
6.
Forgreninger
❱
6.1.
Conditionals
6.2.
for-løkker
6.3.
break and continue
6.4.
Blocks and Scopes
6.5.
Funktioner
6.6.
Macros
6.7.
Exercise: Collatz Sequence
❱
6.7.1.
Løsninger
Dag 1: Eftermiddag
7.
Velkommen
8.
Tuples and Arrays
❱
8.1.
Tuples and Arrays
8.2.
Array Iteration
8.3.
Mønstergenkendelse
8.4.
Dekonstruktion af enumerationer
8.5.
Exercise: Nested Arrays
❱
8.5.1.
Løsninger
9.
Referencer
❱
9.1.
Referencer
9.2.
Hængende referencer
9.3.
Exercise: Geometry
❱
9.3.1.
Løsninger
10.
User-Defined Types
❱
10.1.
Strukturer
10.2.
Tuple-strukturer
10.3.
Enumerationer
10.4.
static & const
10.5.
Type Aliases
10.6.
Exercise: Elevator Events
❱
10.6.1.
Løsninger
Dag 2: Formiddag
11.
Velkommen
12.
Mønstergenkendelse
❱
12.1.
Dekonstruktion af enumerationer
12.2.
Forgreninger
12.3.
Exercise: Expression Evaluation
❱
12.3.1.
Løsninger
13.
Asynkrone egenskaber (eng. Traits)
❱
13.1.
Metoder
13.2.
Traits
13.3.
Deriving
13.4.
Trait Objects
13.5.
Øvelser
❱
13.5.1.
Løsninger
14.
Generics
❱
14.1.
Funktioner
14.2.
Generic Data Types
14.3.
Trait Bounds
14.4.
impl Trait
14.5.
Exercise: Generic min
❱
14.5.1.
Løsninger
Dag 2: Eftermiddag
15.
Velkommen
16.
Standard Library Types
❱
16.1.
Standard Library
16.2.
Officiel dokumentation
16.3.
Undtagelser
16.4.
Option, Result
16.5.
Path, OsString
16.6.
Vec
16.7.
HashMap
16.8.
Øvelser
❱
16.8.1.
Løsninger
17.
Standard Library Traits
❱
17.1.
Sammenligninger
17.2.
Iteratorer
17.3.
From og Into
17.4.
Casting
17.5.
Read og Write
17.6.
Default, struct update syntax
17.7.
Closures
17.8.
Øvelser
❱
17.8.1.
Løsninger
Day 3: Morning
18.
Velkommen
19.
Håndtering af hukommelse
❱
19.1.
Review of Program Memory
19.2.
Hukommelseshåndtering i Rust
19.3.
Ejerskab
19.4.
Overførselssemantik
19.5.
Clone
19.6.
Sammensatte typer
19.7.
Drop
19.8.
Exercise: Builder Type
❱
19.8.1.
Løsninger
20.
Smart Pointers
❱
20.1.
Box
20.2.
Rc
20.3.
Exercise: Binary Tree
❱
20.3.1.
Løsninger
Day 3: Afternoon
21.
Velkommen
22.
Lån af variabler
❱
22.1.
Lån af variabler
22.2.
Lån af variabler
22.3.
Interior Mutability
22.4.
(tilbage til øvelsen)
❱
22.4.1.
Løsninger
23.
Livstider
❱
23.1.
Slices: &\[T\]
23.2.
Hængende referencer
23.3.
Livstider i funktionskald
23.4.
Livstider
23.5.
Livstider
23.6.
Exercise: Protobuf Parsing
❱
23.6.1.
Løsninger
Dag 1: Formiddag
24.
Velkommen
25.
Iteratorer
❱
25.1.
Iterator
25.2.
IntoIterator
25.3.
Iterator
25.4.
Exercise: Iterator Method Chaining
❱
25.4.1.
Løsninger
26.
Modules
❱
26.1.
Modules
26.2.
Filesystem Hierarchy
26.3.
Visibility
26.4.
use, super, self
26.5.
Exercise: Modules for a GUI Library
❱
26.5.1.
Løsninger
27.
Testing
❱
27.1.
Test Modules
27.2.
Andre projekter
27.3.
Useful Crates
27.4.
GoogleTest
27.5.
Mocking
27.6.
Compiler Lints and Clippy
27.7.
Luhn-algorithmen
❱
27.7.1.
Løsninger
Dag 1: Eftermiddag
28.
Velkommen
29.
Error Handling
❱
29.1.
Panics
29.2.
Try Operator
29.3.
Implicitte konverteringer
29.4.
Error
29.5.
From og Into
29.6.
Exercise: Rewriting with Result
❱
29.6.1.
Løsninger
30.
Unsafe Rust
❱
30.1.
Unsafe
30.2.
Dereferencing Raw Pointers
30.3.
Mutable Static Variables
30.4.
Unions
30.5.
Funktioner
30.6.
Asynkrone egenskaber (eng. Traits)
30.7.
Exercise: FFI Wrapper
❱
30.7.1.
Løsninger
Android
31.
Velkommen
32.
Setup
33.
Build Rules
❱
33.1.
Binary
33.2.
Library
34.
AIDL
❱
34.1.
Interface
34.2.
Implementation
34.3.
Server
34.4.
Deploy
34.5.
Client
34.6.
Changing API
35.
Logging
36.
Interoperability
❱
36.1.
With C
❱
36.1.1.
Calling C with Bindgen
36.1.2.
Calling Rust from C
36.2.
With C++
❱
36.2.1.
The Bridge Module
36.2.2.
Rust i Android
36.2.3.
Generated C++
36.2.4.
C++ Bridge
36.2.5.
Skalartyper
36.2.6.
Shared Enums
36.2.7.
Rust Error Handling
36.2.8.
C++ Error Handling
36.2.9.
Additional Types
36.2.10.
Building for Android: C++
36.2.11.
Building for Android: Genrules
36.2.12.
Building for Android: Rust
36.3.
With Java
37.
Øvelser
Chromium
38.
Velkommen
39.
Setup
40.
Comparing Chromium and Cargo Ecosystems
41.
Policy
42.
Build Rules
❱
42.1.
Unsafe Code
42.2.
Depending on Rust Code from Chromium C++
42.3.
Visual Studio Code
42.4.
Øvelser
43.
Testing
❱
43.1.
rust_gtest_interop Library
43.2.
GN Rules for Rust Tests
43.3.
chromium::import! Macro
43.4.
Øvelser
44.
Interoperability with C++
❱
44.1.
Eksempler
44.2.
Limitations of CXX
44.3.
CXX Error Handling
❱
44.3.1.
Error Handling: QR Example
44.3.2.
Error Handling: PNG Example
44.4.
Rust i Android
44.5.
Øvelser
45.
Adding Third Party Crates
❱
45.1.
Configuring Cargo.toml
45.2.
Configuring gnrt_config.toml
45.3.
Downloading Crates
45.4.
Generating gn Build Rules
45.5.
Resolving Problems
❱
45.5.1.
Build Scripts Which Generate Code
45.5.2.
Build Scripts Which Build C++ or Take Arbitrary Actions
45.6.
Depending on a Crate
45.7.
Reviews and Audits
45.8.
Checking into Chromium Source Code
45.9.
Keeping Crates Up to Date
45.10.
Øvelser
46.
Bringing It Together - Exercise
47.
Øvelser
Rå jern: Formiddag
48.
Velkommen
49.
no_std
❱
49.1.
Et minimalt eksempel
49.2.
alloc
50.
Microcontrollers
❱
50.1.
Rå MMIO
50.2.
PAC'er
50.3.
HAL Crates
50.4.
Board Support Crates
50.5.
The Type State Pattern
50.6.
embedded-hal
50.7.
probe-rs, cargo-embed
❱
50.7.1.
Fejlfinding
50.8.
Andre projekter
51.
Øvelser
❱
51.1.
Kompas
51.2.
Løsninger
Rå jern: Eftermiddag
52.
Application Processors
❱
52.1.
Getting Ready to Rust
52.2.
Inline Assembly
52.3.
MMIO
52.4.
Let's Write a UART Driver
❱
52.4.1.
More Traits
52.5.
A Better UART Driver
❱
52.5.1.
Bitflag
52.5.2.
Multiple Registers
52.5.3.
Driver
52.5.4.
Anvendelse
52.6.
Logging
❱
52.6.1.
Anvendelse
52.7.
Undtagelser
52.8.
Andre projekter
53.
Useful Crates
❱
53.1.
zerocopy
53.2.
aarch64-paging
53.3.
buddy_system_allocator
53.4.
tinyvec
53.5.
spin
54.
Android
❱
54.1.
vmbase
55.
Øvelser
❱
55.1.
RTC Driver
55.2.
Løsninger
Concurrency: Morning
56.
Velkommen
57.
Tråde
❱
57.1.
Tråde med virkefelt
58.
Kanaler
❱
58.1.
Ubegrænsede kanaler
58.2.
Begrænsede kanaler
59.
Send og Sync
❱
59.1.
Send
59.2.
Sync
59.3.
Eksempler
60.
Delt tilstand
❱
60.1.
Arc
60.2.
Mutex
60.3.
Eksempel
61.
Øvelser
❱
61.1.
Filosoffer omkring spisebordet
61.2.
Flertrådet linktjekker
61.3.
Løsninger
Concurrency: Eftermiddag
62.
Grundlæggende Async
❱
62.1.
async/await
62.2.
Fremtidige resultater (eng. Futures)
62.3.
Runtimes
❱
62.3.1.
Tokio
62.4.
Opgaver (eng. Tasks)
62.5.
Asynkrone kanaler
63.
Forgreninger
❱
63.1.
Join
63.2.
Select
64.
Faldgruber
❱
64.1.
Blocking the Executor
64.2.
Pin
64.3.
Asynkrone egenskaber (eng. Traits)
64.4.
Annulering
65.
Øvelser
❱
65.1.
Filosoffer omkring spisebordet
65.2.
Broadcast chat-applikation
65.3.
Løsninger
Afsluttende bemærkninger
66.
Tak!
67.
Glossary
68.
Andre resourcer
69.
Anerkendelser
Light
Rust
Coal
Navy
Ayu
Comprehensive Rust 🦀
English
Brazilian Portuguese (Português do Brasil)
Chinese Simplified (汉语)
Chinese Traditional (漢語)
Japanese (日本語)
Korean (한국어)
Spanish (Español)
Ukrainian (українська)
Øvelser
Solutions to the Chromium exercises can be found in
this series of CLs
.