Unsafe Rust - Complete Tutorial
HTML-код
- Опубликовано: 16 июл 2024
- 💰 FREE Software Dev Intro Course - calcur.tech/free-dev-course
💯 FREE Courses (100+ hours) - calcur.tech/free-courses
Timestamps:
00:00 - Introduction
02:08 -Create a Project
03:33 - Converting from a Smart Pointer
05:24 - Calling an Unsafe Function
06:55 - Safe Interface
07:47 - Modifying Mutable Statics
09:18 - Unsafe Traits
10:32 - Unions
12:37 - Untagged Union
12:58 - Tagged Union
🏆 C++ Mastery Course - cppmastery.com
⚛️ FREE React Course (20 hours) - calcur.tech/free-react-course
✅ Data Structures & Algorithms - calcur.tech/dsa-youtube
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
✉️ Newsletter - calcur.tech/newsletter
📸 Instagram - / calebcurry
🐦 Twitter - / calebcurry
🔗 LinkedIn - / calebcurry
▶️ Subscribe - calcur.tech/subscribe
👨🏻🎓 Courses - www.codebreakthrough.com
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
↪ My Amazon Store - www.amazon.com/shop/calebcurry
🅿 Patreon - calcur.tech/patreon-calebcurry
🅖 GitHub Sponsors - github.com/sponsors/CalebCurry
Ⓟ Paypal - paypal.me/calcur Наука
💰 FREE Software Dev Intro Course - calcur.tech/free-dev-course
💯 FREE Courses (100+ hours) - calcur.tech/free-courses
Timestamps:
00:00 - Introduction
02:08 -Create a Project
03:33 - Converting from a Smart Pointer
05:24 - Calling an Unsafe Function
06:55 - Safe Interface
07:47 - Modifying Mutable Statics
09:18 - Unsafe Traits
10:32 - Unions
12:37 - Untagged Union
12:58 - Tagged Union
IMHO, the existence of the unsafe block totally defeats the purpose of Rust existing.
You can force a project to not use unsafe, but sometimes it is required such as when interfacing with C
@@codebreakthrough Well, that's good to know, but I don't think it's enough. Maybe if you could configure your project to not allow unsafe mode not only in your own project's code, but also in any third party library and dependencies it used, then that would be better.
I think rust devs pay too high a price for the borrow checker to still be exposed to unsafe code.
Not worth it IMO.
Something like Zig is better.
@@rafae5902 Zig shill spotted