Skip to content
0:00 / 0:00

#lifetimes#borrowchecker#references

Rust Lifetimes Finally Explained!

Let's Get Rusty

177K subscribers • 8 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.

Beginner. No background in the topic needed.

218K views5 years ago2 recommendations

Programming languagesRust

An introductory tutorial explaining Rust lifetimes, the borrow checker, lifetime elision, and generic lifetime annotations.

Join our Rust Live Accelerator waitlist (free Rust Job-Ready Roadmap inside): letsgetrusty.com/join Let’s Get Rusty is the #1 Rust education & career development platform for engineers who want real-world skills and results. We combine a structured curriculum, industry-grade projects, expert review and feedback, and our Rust recruiter network — to help you master Rust and get hired. · The ultimate Rust lang tutorial. Follow along as we go through the Rust lang book chapter by chapter. 📝 Get your *FREE Rust Cheat Sheet*: letsgetrusty.com/cheatsheet The Rust book: doc.rust-lang.org/stable/book/​ Intro The Borrow Checker Generical Lifetime Annotations Thinking in Terms of Lifetimes Lifetime Annotations in Struct Definitions Lifetime Elision Lifetime Annotations in Method Definitions Static Lifetimes Putting it All Together Outro #letsgetrusty​ #rust​lang #tutorial

Why it's here

2 people recommend this

What people say. Recommended as a helpful resource for understanding Rust's lifetime and borrowing concepts.

u/pilkytonin r/rust • Recommends

On “Should I create a reference when getting value from a Option<&SomeStruct>?”

…etime of all references in an annotated group (such as `'a`) and just uses it as a hint to figure out how long a reference is expected to live. Lifetime annotations don't CHANGE the lifetimes at all. It just helps the compiler figure out complex borrowing. His explanation doesn't teach the viewer ANY of that. Btw, there's a great video on YouTube: link to this video - When he first attempts to explain Error Handling, he says that he's "propagating unhandled errors back to the caller", but his code example swallows the unhandled errors and just debug-prints them silently (no propagation). He actually has a chapter after that about how to propagate errors, but why did he decide to confuse the students by…

u/bigh-ausin r/rust • Recommends

On “My learning journey with Rust as a 20 YOE dev”

Lifetimes: [video Async: [video Bogdan's videos have I don't profess to be an expert - I'm still learning rust, but I absolutely see the benefits of rust. There are unfortunately plenty of drawbacks too. The ecosystem people use is all over the place - competing crates, with names that aren't intuitive some of the time. If you really want to deconstruct then you should look at converting your code to assembly language and see how it works under the hood. I get what you mean though - you want to understand what the rust compiler is doing under the hood, *why* things work in a certain way. The difficulty is that with many languages these days (eg rust and java / spring) the…