Who Owns This Stream of Data?
summary
Rust's iterator APIs map ownership precisely: into_iter / iter / iter_mut / drain give owned values, shared refs, exclusive refs, and partial moves; the borrow checker and lifetimes (e.g. using slice split_at) explain why calling next repeatedly is safe and why indexing or swap_remove is needed for concurrent modification. A proposed streaming iterator links lifetimes to forbid repeated next and enable prev/insert/remove operations; a concrete cursor on a linked list proves the idea works today.
AI-written summary · about
chapters (11)
- 0:00Start
- 0:48Let's talk about this for 30 minutes
- 2:58Collection Iterator Dream Team
- 4:36Iter - Shared References (&T)
- 13:16Why does the API allow this?
- 17:39Borrow Checker Escape Hatch: Indices!
- 21:30Good Actual mutual exclusion!
- 22:23Going Backwards!
- 22:57Going Crazy!
- 23:26We don't need no stinkin' traits!
- 24:44Conclusions
related talks
28mYou Don't Own Me
40mAdvanced Rust Programming Techniques
45mRust: safe and concurrent. But how does it do it?
25mCompositional Reasoning about Advanced Iterator Patterns in Rust
01h 05mKeynote - Rust: confident, productive systems programming
32mChannels in Rust: The Art of Concurrency
01h 29mA Friendly Introduction to Rust for C++ Developers
39mLevel Up Your Concurrency Skills With Rust
