What's structural pinning?

what's structural pinning and when is it okay to expose the field of a pinned struct? thanks!

std::pin has a pretty good summary of both what it is, and when it's ok:

The very TLDR is "if you're consistent, you can safely reborrow a pinned reference to a struct as a pinned reference to a field"

yeah, I see. thanks for linking the docs. I'll start reading it!
just one question: what do you mean by consistent? thanks!

It's gotten more into in those docs, but basically you need to only hand out the field as pinned or as not pinned. Either is fine, but if safe code can access both it can cause UB by moving out of the unpinned reference between uses of the pinned reference.

There's a bit of wiggle room depending on your actual API, but that's the rule of thumb.