1. Why Rust is Safe
RustCurious
0:00 / 0:00
1. Why Rust is Safe
7 290 просмотров · 1 г. назад
RustCurious
2,86 тыс. подписчиков
7 290 просмотров · 1 г. назад
Rust is a systems language with just as much control and performance as C or C++. And yet, it guarantees memory safety and thread safety at compile-time. How is that possible?
Complete Rust course: • All Lessons
🚀 https://rustcurious.com
00:00 Fast, full control, and safe?
01:52 Safe vs unsafe
04:59 Thought experiment language: C without pointers
07:47 Move-only types protect resources by preventing implicit copy
11:13 Borrowed references are safe pointers for temporary exclusive access
16:46 Review, copyable vs move-only types
20:19 Safe heap-allocated memory
23:25 Regions enable returning a borrowed reference from a function
28:23 Shared references allow aliased read-only access
32:30 Mutable XOR shared - multiple readers or one writer
35:28 Thread safety is enforced at compile-time
37:46 Learning actual Rust