Ownership enables Rust to make memory safety guarantees without needing a garbage collector.
- Whatever we discussed until this point…is fairly common in other programming languages.…But now is when things get interesting.…The concept of ownership is unique to Rust.…But before we start off with ownership,…we need to understand in specific,…how memory management actually works.…Here's an illustration of the stack and the heap.…They're both chunks of memory available to your code…at run time, but they're structured in different ways.…
The stack stores values in the order it gets them,…and removes the values in the opposite order.…This is referred to as last in, first out.…Think of a stack of plates, when you add more plates,…you put them on the top of the pile,…and when you need a plate you take one off the top.…Adding data is called pushing onto the stack…and removing data is called popping off the stack.…The stack is fast because of the way it accesses the data.…
It never has to search for a place…to put new data or a place to get data from…because that place is always the top.…All data on the stack must take up a known, fixed size.…
- Installing Rust
- Data types
- Adjusting memory allocation
- Setting up race conditions
- Working with functions
- Exploring references and borrowing
- Using structs
- Method syntax
- Demonstrating recoverable errors with Result
- Working with enums
- Getting user input
Skill Level Beginner
Programming Foundations: Data Structures (2014)with Simon Allardice2h 29m Intermediate
1. Hello, Rust!
2. Basic Programming Concepts
3. Ownership in Rust
4. Data Handling and Pattern Matching in Rust
5. Error Handling
6. Sample Rust Project: The Guessing Game
Next steps1m 14s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.