Get the latest tech news
Pin
The Pin type (and the concept of pinning in general) is a foundational building block on which the rest of the the Rust async ecosystem stands. Unfortunately, it has also been one of the least accessible and most misunderstood elements of async Rust.
This creates a complexity spike, particularly in parts of async Rust where futures need to be self-referential and store state, so you must wrap Self with Pin to guarantee it’s not going to move. The goal of Pin is to make it safe to manipulate self-referential types generated by the compiler from an async function or implemented with unsafe code in a runtime like tokio. This was already not very appealing: a lot of APIs don’t need the value to be movable and would presumably gain a?Move bound, making Rust documentation harder to understand across the board.
Or read this on Hacker News