Skip to content
0:00 / 0:00

#rust#lifetimes#borrowchecker

Rust Lifetimes

Doug Milford

8.6K subscribers • 3 videos on Hallway

YouTube
  • Recommended by 3 people: 3 in engineering communities.
  • Presented by Doug Milford

Beginner. No background in the topic needed.

57K views6 years ago3 recommendations

Programming languagesRustMemory management

Doug Milford explains Rust lifetimes through practical examples to help developers understand memory safety and borrowing.

An introduction to Rust Lifetimes through example. In addition to this video, Arseniy Kucherenko has made an addendum to this video talking about static lifetimes. Very informative! I recommend you check it out. youtube.com/watch?v=qzp9gD6BfU4 This Rust programming language tutorial series is aimed at easing your training step by step. Rust is a systems level language aimed at speed and safety and can be run cross-platform, including embedded systems and even the browser with WebAssembly (WASM)! I use the VS Code development environment to help you learn the core topics. Please join me on this journey with this fantastic new programming language. Topics include coding basics, hello world, primitives, cargo, toml, rustup, arrays, borrowing, shadowing, string vs str, tuples, enumerations (enums), println and so much more...all free on youtube!

Why it's here

3 people recommend this

What people say. Recommended as an exceptionally clear and useful video tutorial for understanding Rust lifetimes.

Moments people linked to

u/Deloskoteinosin r/rust • Recommends

On “Resources on Lifetimes”

Two things: 1. I found this youtube video very useful: Rust Lifetimes by Doug Milford. 2. I'm pretty sure "lifetimes" is just an unfortunate misnomer. Re: #2 -- I found it helpful to realize that what are called "lifetimes" are actually more like "*shared-lesstimes*". e.g. here:`fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {...}` It *doesn't make sense* to say that **'a** is the lifetime of x and y -- we're *not* setting their lifetimes to be equal *nor* requiring that they be equal. What **'a** *is* is a set of lifetimes *less than* (or equal to) x AND y. If we were to give imaginary units (pretend with me for a sec) to how long two arguments that were given live, say x lives…

u/DingDongHelloWhoIsItin r/rust • Recommends

On “Ownership as explained in the Rust book”

The Doug Milford videos worked for me Ownership link to this video Lifetimes link to this video

u/Ytrogin r/programming • Recommends

On “Writing the same CLI application twice using Go and Rust: a personal experience”

Great article. Thanks 😊👍 I found this great video about Rust lifetimes a while ago: link to this video

u/solidiquis1in r/rust • Mentions

On “Officially one year on Rust”

My little tip: You may think you're avoiding lifetimes, but what you're actually doing is **eliding** lifetimes. Rust uses three rules to determine whether or not you can elide in particular situations, but at its core, Rust is a language built around this concept. The longer you're on Rust and the more sophisticated your programs become, I do believe that directly interacting with lifetimes (can't elide it) becomes inevitable. Two suggestions if you eventually decide to tackle lifetimes head on: 1. This youtube video, which is a great primer on lifetimes. 2. Keep revisiting The Book every so often the more Rust you write :\] edit: Glad you're on this journey! Happy 3 months :\]
5View on Reddit