Practical examples of when you’d need to Pin

56 points ExternCrateAlloc

Hi all,

You may have picked up this fantastic article from a recent edition of “This week in Rust” - https://sander.saares.eu/2024/11/06/why-is-stdpinpin-so-weird/

It does a great job of Pins mechanics, but I’m looking for advice on where you’ve had a need to explicitly Pin something. “The easiest way to do this is to create a type that holds a pointer or reference to itself”, when is this advantageous and at which point do you

  • need to Pin
  • decide you need to Pin instead of relying on smart pointers.

Thanks,
Your 🦀-ey pal,
ECA