Understanding Ownership in Rust

231,355
0
Published 2021-02-07
The ultimate Rust lang tutorial. Follow along as we go through the Rust lang book chapter by chapter.

📝 Get your FREE Rust Cheatsheet: www.letsgetrusty.com/cheatsheet

The Rust book: doc.rust-lang.org/stable/book/​

Stack & Heap explanation:    • Pointers and dynamic memory - stack v...  


0:00 Intro
0:40 Ownership Model
4:30 Stack & Heap
6:53 Ownership Rules
7:21 Variable Scope
8:22 Memory & Allocation
10:32 Ownership & Functions
12:23 References & Borrowing
18:34 The Slice Type
24:56 Outro


#letsgetrusty​ #rust​lang #tutorial

All Comments (21)
  • @enderger5308
    I don’t know why, but the borrow checker doesn’t confuse me that much. Use a reference when you want to see the original memory through a window, move when you want the data for yourself, and never have a window to a place that does not exist.
  • @eileennoonan771
    I am going to watch this every day until I understand it in my bones
  • As a line-of-business developer I've been a bit intimidated about learning an innovative system language like Rust - but this makes one of the gnarliest features seem learnable. You're a good teacher.
  • @desrucca
    Finally, found someone that covers the rust guide book. Thanks, man. Super time saver
  • @jesusmtz29
    im amazed at how much the rust-analyzer and compiler are teaching me without even running code. You're explanation makes it a top-grade experience
  • @-karter-4556
    I wish I found this language sooner 😫. The control and defined, predictable behavior is so appealing.
  • @biocuts
    You explained it in a very concise and clear way. Good job!
  • @SKyrim190
    I think that was the best explanation I've come across so far...you took the time a noobie would need to learn this stuff, and didn't try to "keep under two minutes" destroying the clarity for the sake of speed. Also, you didn't jump immediately to metaphors of "oh, its like if you have a book, and you lend it to someone, but that person can write on the book" and so on...I also find those unnecessary and confusing sometimes
  • So I recently just made my first foray into Rust by attempting to build a calculator in a Yew app. I am still struggling with the logic itself, but I actually found the battle with the borrow checker to be one of the more refreshing sorts of problems I ran into. It made me think so much harder about where I was declaring my variables and where I was mutating them that it kinda just felt like my brain was steadily increasing in mass and wrinkle count the whole time.
  • This is by far the best explanation about Rust's borrow mechanism I've encountered so far! The course is an excellent resource for Rust newcomers. Great work!
  • @Haitaish
    10:53 "When we pass in parameters into a function its the same as if we were to assign s into another variable" - now that's when the borrow checker finally clicked for me. Now I also understand why it's so controversial to some people. Your tutorial so clear and easy to understand. Thank you!
  • @bobbybob628
    The very best channel for Rust learners that I have found so far! Thank you, buddy! Wish you all the best and prosperity to your channel!
  • @Antonio-ix3fw
    I have just started learning Rust and your videos are helping me to understand all the tricky Rust concepts. Thanks! .
  • @scheimong
    Wish I had this video last year when I was learning Rust. You explained the concepts fantastically.
  • @MCGreen13
    This was the best outline of this topic that I’ve seen. Thank you.
  • Honestly man, your videos have really helped me whilst I go through the book. Theres a lot of information to consume so appreciate you taking the time to make these accompanying videos (y), some things are easier to see than to read and vice versa :)
  • @twentyeightO1
    Man I'm getting all worked up converting my c++ program to rust. 2 days in and I am no where near to finish it. Now I've realized that my "c++ way of thinking" is getting in the way.
  • @sukarnarut
    Awesome teaching. The pace is very good and information goes straight into my brain with good understanding of the concept.