HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

The Why, What, and How of Pinning in Rust

Jon Gjengset3 HN recommenders · recommended in 3 months, 2021-2026
YouTube
87K views · 7 years ago · tutorial · evergreen

Jon Gjengset's long live-coding stream explains Rust's Pin and Unpin types: why they exist, how they work, and how they connect to futures and async/await. It also covers moving from pre-pinning code to the new model.

HN treats it as the definitive resource for understanding Pin semantics and lists it among async Rust learning materials.

C, C++, Rust, Go & systems languagesProgramming language design#rust#pin#unpin#asyncawait#futures#livecoding

3 comments from Hacker News

@lame_lexem2026 · in “Async Rust never left the MVP state”

there is a chapter on async in comprehensive rust and rustbook which ought to bring you up to speed there is the async book but it is largely unfinished you can watch John Gjengset's crust of rust async, decrusting tokio, and why what, and how of pinning in rust then there are tokio-lessons and tokio tutorial which teach how to use tokio runtime and there are also good blogposts by phil-oop and rose wright on how async works link link link link link ▶ this video link link link link

RecommendsView on HN
@theossuary2023 · in “Effing-mad, an effect library for Rust”

Jon Gjengset's stream on pin/unpin is invaluable for understanding Pin semantics: ▶ this video But the 10000 ft view is: Pin lets you tell Rust to never ever move a piece of memory. This is almost always done because the piece of memory has pointers into itself (it's self referencial) which would be come invalid if moved.

Strongly recommendsView on HN
@DasIch2021 · in “Things you can’t do in Rust (and what to do instead)”

Let's assume for a moment self-referential references were allowed. Let's further say we have such a struct containing self-referential references and we move it. Moving actually moves things in memory, including the thing those references reference. This means the references now point at the old and now incorrect location. Accessing them would trigger undefined behavior. Self-referencing is only acceptable, if the struct is guaranteed not to move. Rust does provide a mechanism to provide such a guarantee with std::pin but outside of async code, you probably don't want to be using it. std::pin: link If you're curious about pinning and have a few hours to spare, ▶ this video is a great video that explains it in detail.

RecommendsView on HN
Crust of Rust: async/await2:34:01

Crust of Rust: async/await

Jon Gjengset
246K views • 5 years ago
Rust's Journey to Async/Await48:46

Rust's Journey to Async/Await

InfoQ
90K views • 7 years ago
Crust of Rust: Lifetime Annotations1:33:23

Crust of Rust: Lifetime Annotations

Jon Gjengset
299K views • 6 years ago
RustLatam 2019 - Without Boats: Zero-Cost Async IO32:24

RustLatam 2019 - Without Boats: Zero-Cost Async IO

Rust Programming Language
55K views • 7 years ago
Rust: A Language for the Next 40 Years - Carol Nichols55:08

Rust: A Language for the Next 40 Years - Carol Nichols

ChariotSolutions
367K views • 7 years ago
Rust NYC: Jon Gjengset - Demystifying unsafe code29:25

Rust NYC: Jon Gjengset - Demystifying unsafe code

Rust Programming Language
27K views • 6 years ago
Hacking with Andrew and Brad: tip.golang.org1:02:49

Hacking with Andrew and Brad: tip.golang.org

The Go Programming Language
99K views • 11 years ago
Rust at speed — building a fast concurrent database52:54

Rust at speed — building a fast concurrent database

Jon Gjengset
225K views • 7 years ago
GopherCon 2014 Inside the Gophers Studio with Blake Mizerany48:19

GopherCon 2014 Inside the Gophers Studio with Blake Mizerany

Confreaks
8K views • 12 years ago
Implementing (part of) a BitTorrent client in Rust4:09:16

Implementing (part of) a BitTorrent client in Rust

Jon Gjengset
115K views • 3 years ago
Modeling Data Concurrency w/ Asynchronous I/O in Zig - RedisConf 202049:20

Modeling Data Concurrency w/ Asynchronous I/O in Zig - RedisConf 2020

Redis
11K views • 6 years ago
GopherCon 2014 Opening Keynote by Rob Pike56:36

GopherCon 2014 Opening Keynote by Rob Pike

Confreaks
38K views • 12 years ago
Lang NEXT 2014 Panel  Systems Programming in 2014 and Beyond1:05:56

Lang NEXT 2014 Panel Systems Programming in 2014 and Beyond

25msr
3K views • 8 years ago
The Go Programming Language59:26

The Go Programming Language

Google TechTalks
406K views • 17 years ago
[#36] Zig Roadmap 2024 - Andrew Kelley1:00:23

[#36] Zig Roadmap 2024 - Andrew Kelley

Zig SHOWTIME
66K views • 2 years ago
Going Native 2012 Keynote Stroustrup1:29:49

Going Native 2012 Keynote Stroustrup

savage309
33K views • 14 years ago
OSCON 2010:  Rob Pike, "Public Static Void"12:31

OSCON 2010: Rob Pike, "Public Static Void"

O'Reilly
119K views • 16 years ago
Origins of Go Concurrency style by Rob Pike38:19

Origins of Go Concurrency style by Rob Pike

jasonofthel33t
28K views • 14 years ago
RustConf 2020 - Closing Keynote by Siân Griffin39:03

RustConf 2020 - Closing Keynote by Siân Griffin

Rust Programming Language
10K views • 6 years ago
C++ and Beyond 2012: Herb Sutter - atomic Weapons 2 of 21:32:33

C++ and Beyond 2012: Herb Sutter - atomic Weapons 2 of 2

alexsmail
29K views • 9 years ago