Pinning - Asynchronous Programming in Rust: Why, What, and How
Channel: Code Geek
Date: 19/10/2022

The Why, What, and How of Pinning in Rust. What these types are, why they are needed, how they work, and how to use them. Pinning - Asynchronous Programming in Rust. 
Why you should learn the Rust programming language
☞ https://morioh.com/p/448ccc18ac32
Learning Rust with TypeScript
☞ https://morioh.com/p/1b14c7ddbe9f
Building a WebAssembly Module from Rust
☞ https://morioh.com/p/6b4517f26095

With the Future trait stabilized and async/await coming soon, many more people are being exposed to the Pin type and its sibling trait Unpin. In this video, we dive deep into what these types are, why they are needed, how they work, and how to use them. We also dig into the connection to Futures and async/await, and discuss how you safely move from old code that does not use pinning to new code that does.

This is pretty dense and subtle material, but hopefully serves as a good and thorough overview of pinning in Rust. If you want to know how it all fits together, this stream probably has you covered! To help you navigate, here are the major transition points:

0:03:50 — What's the problem we're trying to solve?
0:28:19 — How does pinning help?
0:31:55 — What is Unpin?
0:35:14 — Working with pinned types
0:44:20 — An example of implementing Future
0:51:02 — Pin::new vs Pin::new_unchecked
0:59:16 — The problem with Drop
1:03:13 — Quick recap
1:07:26 — Why impl Unpin is safe
1:12:34 — Structural pinning
1:30:14 — The curious case of Box::pin
1:50:49 — Avoiding unsafe with pin-project
2:04:59 — Why is Pin::set okay?
2:08:03 — Pinning beyond Future
2:12:30 — Some quick questions
2:17:02 — Real-world examples of transitioning to Pin in tower
2:26:34 — pin-project and Drop
2:34:17 — Q&A!

#Rust #Pinning #Asynchronous

PUBLICATION PERMISSIONS:
Original video was published with the Creative Commons Attribution license (reuse allowed)

CREDITS:
Original video source: https://www.youtube.com/watch?v=DkMwYxfSYNQ
------------------------------------------------------------------------------------ 
Social Network for Developers: http://bit.ly/2R1Lw31
Developer's Store: http://bit.ly/2L27JNR 
Fanpage: http://bit.ly/2LyM4fJ

------------------------------------------------------------------------------------ 
Social Network for Developers: http://bit.ly/2R1Lw31
Developer's Store: http://bit.ly/2L27JNR 
Fanpage: http://bit.ly/2LyM4fJ
Twitter: http://bit.ly/2J7vCS0