Back to Browse

Introduction to Rust - Part 13: Reference Counting and Interior Mutability

1.3K views
Jan 30, 2022
18:26

This is the 13th in a series of videos that cover, step by step, learning to code using the Rust programming language. In this video we'll cover Reference Counting and Interior Mutability. 0:00 - Introduction 0:23 - Directed Acyclic Graph 1:37 - Reference-counted heap pointer 2:40 - Building a graph 3:58 - Updating display function to walk the graph 4:24 - Fixing errors, finalizing the graph structure 6:30 - Using Drop to track when nodes are released 8:28 - Reference counted objects are immutable 8:48 - Weak pointers 10:39 - Avoiding cyclical references using weak pointers 11:17 - Avoiding lifetime extension using weak pointers 11:38 - Downgrade/upgrade transition between Rc/Weak 11:47 - Introducing RefCell: Interior Mutability 15:14 - How does RefCell work? 17:18 - Use RefCell as a last resort 17:52 - In Summary

Download

1 formats

Video Formats

360pmp428.2 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Introduction to Rust - Part 13: Reference Counting and Interior Mutability | NatokHD