HackerTube.dev

The Why, What, and How of Pinning in Rust

Jon Gjengset · 87.1K views · 2019-09-14 · 3:03:54

Open on YouTube ↗

If playback is restricted in your region, try opening the original video. Use Mark watched to add it to your marked videos.

Overview

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.

On Hacker News

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

Recommended by 3 HN people across 3 months · HN mentions 2021–2026

Topics

Search by tags

What people said

theossuary · 2023-03 · Strong recommendation

Jon Gjengset's stream on pin/unpin is invaluable for understanding Pin semantics: [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.

Read the original HN comment ↗
lame_lexem · 2026-05 · Recommendation

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] [VIDEO] [LINK] [LINK] [LINK] [LINK]

Read the original HN comment ↗
DasIch · 2021-05 · Recommendation

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, [VIDEO] is a great video that explains it in detail.

Read the original HN comment ↗

Sources

Video by Jon Gjengset, played through YouTube.

Data and selection notes

HN summaries and labels may contain AI errors. HN dates refer to discussions, not video publication.

HN Library: HackerTube export (2026-10-31) and open-index/hacker-news. Upstream summaries and classifications may contain AI errors.

Views, duration and playback status refresh separately from the published catalog. When an update fails, existing data remains visible.

Selection checks
  • SaaS & AI candidates: Topic keywords do not match
  • Editor-approved picks: Editorial review is required

Rule matches identify candidates. They do not guarantee video quality or financial results.

About the library and its sources