filmov
tv
Rust: Store Data on the Heap with Box
Показать описание
#rust #smart #box
! At 1:08, I said "Defer Trait", but I actually mean "Deref Trait"
Box is a straightforward example of one Smart Pointer in Rust. Box allows you to store data on the heap instead of the stack. Instead of passing around your data, and copying it’s total memory on the stack, you can use a Box to store the data and avoid the memory copies on the stack and defer to pointer copies on the stack. This is the single responsibility of the Box.
Box is a smart pointer because it implements the `Defer trait` which allows the `T` to be treated like references.
If you are unfamiliar with the concept of stack vs. heap, please refer to The Rust Programming Book chapter 4.
0:00 intro
2:05 Using Box to Store Data on the Heap
3:11 Enabling Recursive Types with Boxes
5:55 Computing the Size of a Non-Recursive Type
8:10 Using Box to Get a Recursive Type with a Known Size
Links
Learn more about traits
Box documentation
! At 1:08, I said "Defer Trait", but I actually mean "Deref Trait"
Box is a straightforward example of one Smart Pointer in Rust. Box allows you to store data on the heap instead of the stack. Instead of passing around your data, and copying it’s total memory on the stack, you can use a Box to store the data and avoid the memory copies on the stack and defer to pointer copies on the stack. This is the single responsibility of the Box.
Box is a smart pointer because it implements the `Defer trait` which allows the `T` to be treated like references.
If you are unfamiliar with the concept of stack vs. heap, please refer to The Rust Programming Book chapter 4.
0:00 intro
2:05 Using Box to Store Data on the Heap
3:11 Enabling Recursive Types with Boxes
5:55 Computing the Size of a Non-Recursive Type
8:10 Using Box to Get a Recursive Type with a Known Size
Links
Learn more about traits
Box documentation
Rust: Store Data on the Heap with Box
Visualizing memory layout of Rust's data types
Visualizing memory layout of Rust's data types [See description/first comment]
The Box Smart Pointer in Rust
RustConf 2018 - Project Mentat: a store for evolving data in Rust Delivered by Grisha Kruglov
Rust: Send Data between Threads
Rust's Alien Data Types 👽 Box, Rc, Arc
Rust 101 - Data types in Rust
Rust Programming Full Course ⚙️ | Learn Rust in 2024 from Scratch!
MASTER RUST - 02 | Data Types & How Rust store Variables & Values?
Beginner's Guide to Rust Filesystem APIs 🦀 Rust Tutorial
Siddon Tang - TiKV - building a distributed key-value store with Rust
Rust + Next-Gen SQL Databases = 😍
Rust 2018: Access All Areas • Florian Gilcher • GOTO 2019
File Upload in Rust | Multipart Form Data | Step by Step Guide
How rust forces you to respect memory
Rust: Storing Multiple Types with Enums and Vecs
Boxes, Heaps, and Stacks - Tim McNamara - Rust Linz, September 2022
Rust Boxes: Efficient Memory Management and Ownership Transfer
How to Write a Distributed Key Value Store in Rust
Sound Data Engineering in Rust—From Bits to DataFrames
Rust Tutorial #9 - Memory Management, Heap & Stack
Rust Zürisee, Dec 2022: Supercharging Zero-Copy Deserialization
Rust as a Tool For Data Scientists? | My Experience
Комментарии