Rc and Arc are two magic and powerful methods of taming Ownership in Rust. Next to this complexity, Rust also has really easy to use one line tricks. If you are interested, I recommend watching this video after understanding the move keyword: https://youtu.be/JRWgzWWMeCs
📝 Description
Discover the ins and outs of Rust's powerful reference counting mechanism with Rc and Arc in this comprehensive video. Join me as we delve into the world of memory management in Rust and explore how Rc and Arc enable efficient memory sharing and prevent memory leaks. We'll cover the differences between Rc and Arc, their use cases, and best practices for leveraging them in your Rust projects.
Important Note: using `.unwrap` without proper error handling is not recommended and should be avoided. I only use `.unwrap` for demonstration purposes in this video.
⏳ Timestamps:
00:00 - Introduction
01:44 - Non-working example
04:28 - Rc Example
10:07 - Arc Example
13:23 - Outro
🔗 Important links:
Rust Rc: https://doc.rust-lang.org/std/rc/struct.Rc.html
Rust Arc: https://doc.rust-lang.org/std/sync/struct.Arc.html
👋 Hey there!
If you are new to this channel: Hey 👋 my name is Flo and I am a professional software engineer with a passion for coding in Golang, TypeScript, JavaScript, and Rust. This channel is where I share that passion and dive into the exciting world of software engineering. Plus, I love using Emojis and paper-based animations (so have a look for that, if you want to find my videos).
📨 Support and Connect!
Buy me a coffee: https://www.buymeacoffee.com/florianwoelki
Become a member: https://www.youtube.com/@flowoelki/membership
Discord: https://discord.gg/TnA7drJ
Instagram: https://www.instagram.com/flowydev/
LinkedIn: https://www.linkedin.com/in/florian-woelki/
TikTok: https://www.tiktok.com/@florianwoelki
GitHub: https://github.com/FlorianWoelki
#Rust #Arc #Rc #ReferenceCounting #MemoryManagement