In this fourth Crust of Rust video, we cover smart pointers and interior mutability, by re-implementing the Cell, RefCell, and Rc types from the standard library. As part of that, we cover when those types are useful, how they work, and what the equivalent thread-safe versions of these types are. In the process, we go over some of the finer details of Rust's ownership model, and the UnsafeCell type. Crust of Rust: Smart Pointers and Interior Mutability
We also dive briefly into the Drop Check rabbit hole (https://doc.rust-lang.org/nightly/nom... ) before coming back up for air.
This is definitely a more technically advanced stream than some of the earlier ones, and may be a little harder to follow. I apologize for that in advance! Please do leave questions here or on Discord and I'll try to help explain what's going on.
You can find the final code at https://gist.github.com/jonhoo/7cfdfe...
0:00:00 Introduction 0:01:11 Discord 0:02:31 Agenda 0:03:50 Interior Mutability 0:07:47 Cell 0:23:39 Trying to Test Cell 0:40:17 UnsafeCell 0:41:21 RefCell 0:54:21 RefCell Smart Pointer 1:06:27 Rc (reference counted ptr) 1:23:49 NonNull 1:31:55 PhantomData and Drop Check 1:44:25 ?Sized Briefly 1:47:30 Thread Safety 1:54:20 Copy-on-Write (Cow)
In this blog, I am going to run around and see the different aspects of programming language rust. And talk about the concepts that it introduces that are useful for various aspects of programming.
In this Rust programming language tutorial, we'll understanding Loops in Rust. Rust currently provides three approaches to performing some kind of iterative activity. They are: loop, while and for. The infinite loop is the simplest form of loop available in Rust. Rust also has a while loop. The for loop is used to loop a particular number of times
This is the very first blog of the series that pertains to create a basic Operating System using Rust Programming Language. The aim of this series is to learn and understand the basics of Operating System. Through this series, you will get some ideas about the internal components of Operating System and how they interact with each other.
An introduction to the Tuples data type. This Rust programming language tutorial series is aimed at easing your training step by step. Rust is a systems leve...
A mix of topics of casting, shadowing, constants and static variables inside the Rust Programming Language. This Rust programming language tutorial series is aimed at easing your training step by step.