mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-03-12 17:51:53 +08:00
chore: sync content to repo (#9707)
Co-authored-by: kamranahmedse <4921183+kamranahmedse@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
969b25ce4b
commit
682d35eee8
@@ -0,0 +1,9 @@
|
||||
# Box
|
||||
|
||||
A `Box` in Rust is a smart pointer that allocates memory on the heap. It's primarily used to store data that has a size that's not known at compile time, or when you want to transfer ownership of data without copying it. Think of it as a way to put data on the heap and access it through a pointer, ensuring that the data is automatically deallocated when the `Box` goes out of scope.
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Using Box<T> to Point to Data on the Heap](https://doc.rust-lang.org/book/ch15-01-box.html)
|
||||
- [@official@Smart Pointers](https://doc.rust-lang.org/book/ch15-00-smart-pointers.html#smart-pointers)
|
||||
- [@video@The Box Smart Pointer in Rust](https://www.youtube.com/watch?v=m76sRj2VgGo)
|
||||
@@ -4,5 +4,4 @@
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Rc<T> in std::rc](https://doc.rust-lang.org/std/rc/struct.Rc.html)
|
||||
- [@official@rct - The Reference Counted Smart Pointer](https://doc.rust-lang.org/book/ch15-04-rc.html#rct-the-reference-counted-smart-pointer)
|
||||
Reference in New Issue
Block a user