Smart Pointers in Rust - Reference Counting

  Рет қаралды 27,234

Let's Get Rusty

Let's Get Rusty

Күн бұрын

Пікірлер: 30
@letsgetrusty
@letsgetrusty 3 жыл бұрын
📝 Get your *FREE Rust cheat sheet* : www.letsgetrusty.com/cheatsheet
@DJenriqez
@DJenriqez 2 жыл бұрын
10/10 for the panic joke :D :D
@bryson2662
@bryson2662 2 жыл бұрын
I love the TV analogy
@josephxavier8636
@josephxavier8636 3 жыл бұрын
Thank you Bogdan, I appreciate your efforts, God bless!
@GolangDojo
@GolangDojo 3 жыл бұрын
God damn, how many parts are there for just smart pointers
@letsgetrusty
@letsgetrusty 3 жыл бұрын
Many many parts
@albertz0
@albertz0 3 жыл бұрын
:)
@nspire3593
@nspire3593 7 ай бұрын
multipart =-=
@ranaahsanansar524
@ranaahsanansar524 3 ай бұрын
very helpful. Awesome tutorial.
@kampkrieger
@kampkrieger 2 жыл бұрын
It would really be helpfull if you add the chapter number into your titles and provide an ordered playlist, so that the videos do not to be searched on the big video page.
@almuaz
@almuaz Жыл бұрын
yes
@yapayzeka
@yapayzeka 2 жыл бұрын
tv example genious.
@jjmalm
@jjmalm 8 ай бұрын
Silly question, how does he display the inferred syntax? Is this an option that can be enabled in one of the plugins?
@dsi7382
@dsi7382 2 жыл бұрын
At 0:37 you're saying that you have cases where a single have has multiple owners, but isn't it a rule of ownership that a variable has only one owner at a time ?
@dsi7382
@dsi7382 2 жыл бұрын
I said that before watching the full video but guess it's what the video is all about, sharing read access to the same value without taking ownership of it. Did I understand correctly ?
@oopss794
@oopss794 2 жыл бұрын
@@dsi7382 same point 👆
@Waradu
@Waradu 6 ай бұрын
I think I leveled up after this tutorial...
@AntonyJudes
@AntonyJudes 3 жыл бұрын
Bro, can you suggest any pdf generation crate with some example, its too hard to create pdf with tables, headings, page numbers, i cant get a way to do this.
@DrIngo1980
@DrIngo1980 3 жыл бұрын
Okay, a simple Google search gives me 3 crates that allow for programmatically generating PDF files. Here they are. I suggest reading the documentation and get cracking. (1) crates.io/crates/printpdf (2) crates.io/crates/pdf-canvas (3) crates.io/crates/genpdf ---- That being said, I have not tried any of those crates myself, so please let us all know which one you end up using and why and maybe post some sample code as well, so we all can learn. Thanks!
@flippert0
@flippert0 Жыл бұрын
The problem maybe isn't so much switching off the TV, but everyone grabbling for the remote to change the channel. Anyway, fitting analogy!
@awesomegamedev
@awesomegamedev 2 жыл бұрын
"If the TV turned off while there were multiple people in the living room, there would be panic" I wonder what would happen in the US if there was a virus outbreak 🤔 People would probably empty all toilet paper off the shelves! Great video! It would be extra cool if you re-implemented counting smart pointer in one of the future videos to understand how it works on a deeper level. I mean, it's simple logically and I wouldn't have trouble doing it in other languages, but Rust specific things might be tricky, and re-implementing some common library stuff seems like a great way to get the hang of them [tricky Rust things].
@jonathanmoore5619
@jonathanmoore5619 3 жыл бұрын
👍
@tailyfale
@tailyfale 3 жыл бұрын
I don't get this example. If we needed to make some incapsulated tuples, we could do this without any enums and boxes.. let elements = (1, (2, (3, 'kindaEnd' ) ) ); and iterate through it until we reach not-a-tuple (in this case, string 'kindaEnd') idk such examples boil my brains. I'm balancing all the time between "chill, its just an example" and "dude try to dig deeper to understand the correlation between examples"
@jacobhinchliffe6659
@jacobhinchliffe6659 3 жыл бұрын
I think using boxes is just more idiomatic but you don't have to use it
@ChumX100
@ChumX100 3 жыл бұрын
Using tuples directly like this wouldn't allow for extending the list multiple ways as shown in the video. The following would break the borrowing rules: let end = (3, String::from("end")); let a = (1, end); let b = (2, end); Of course this would work if we would use a string slice instead of a String, but in that case we would be handling copies and not sharing values as intended. I guess the point of smart pointers is to allow for things that wouldn't be possible otherwise, like defining recursive structures (Box) sharing ownership (Rc) or mutating data with inmutable references (RefCell). If you don't need to do these kind of things, or can find suitable workarounds, sure, you don't need smart pointers at all.
@cjt9150
@cjt9150 3 жыл бұрын
Can you create a video for pdf generation with page headers, footers, tables, page numbers, and suggest a best create for pdf generate
@DrIngo1980
@DrIngo1980 3 жыл бұрын
Okay, a simple Google search gives me 3 crates that allow for programmatically generating PDF files. Here they are. I suggest reading the documentation and get cracking. (1) crates.io/crates/printpdf (2) crates.io/crates/pdf-canvas (3) crates.io/crates/genpdf ---- That being said, I have not tried any of those crates myself, so please let us all know which one you end up using and why and maybe post some sample code as well, so we all can learn. Thanks!
@cjt9150
@cjt9150 3 жыл бұрын
@@DrIngo1980 we are planning to go with genpdf, but having some struggles, once we get in, i will do the best
@DrIngo1980
@DrIngo1980 3 жыл бұрын
@@cjt9150 Hey man, that sounds awesome. Remember, programming is all about learning by "trial by error" (or "trial and error"). So keep trying. Even when you fail, you will have learnt something. And that will increase your XP and skill level. Rinse and repeat and you'll become a master of the craft. 😀
@nathandfox
@nathandfox 2 жыл бұрын
Why is your video seems always has a very faint background music playing.
Smart Pointers in Rust - Interior Mutability
17:04
Let's Get Rusty
Рет қаралды 46 М.
Rust's Alien Data Types 👽 Box, Rc, Arc
11:54
Code to the Moon
Рет қаралды 157 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Smart Pointers in Rust - The Deref Trait
10:01
Let's Get Rusty
Рет қаралды 38 М.
Rust: Weak References
19:40
The Dev Method
Рет қаралды 4,3 М.
are "smart pointers" actually smart?
9:44
Low Level
Рет қаралды 82 М.
Concurrency in Rust - Sharing State
9:12
Let's Get Rusty
Рет қаралды 38 М.
The Box Smart Pointer in Rust
12:18
Let's Get Rusty
Рет қаралды 77 М.
Arc instead of Vec? | Prime Reacts
37:18
ThePrimeTime
Рет қаралды 71 М.
Implementing Rust Traits
12:19
Andrew Burgess
Рет қаралды 14 М.
Use Arc Instead of Vec
15:21
Logan Smith
Рет қаралды 165 М.
Choose the Right Option
18:14
Logan Smith
Рет қаралды 80 М.
Rust Interior Mutability - Sneaking By The Borrow Checker
16:02
Code to the Moon
Рет қаралды 76 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН