|
|
|
|
|
by krukah
704 days ago
|
|
Another great WithoutBoats writeup. Admittedly, this is one of those corners of Rust that I'm glad is abstracted away and buried in async runtime internals. That said, I'm curious if/when/why/how anyone uses Pin<T> outside of a custom Future implementation? |
|
The way it's phrased it makes me understand a bit that it could be used within FFI, like if you get a pointer from a extern function that returns a *mut T, I could have better semantics by wrapping it with Pin<&mut T>, but then it says
"Another fact about the pinned typestate is that for most types it is completely irrelevant. If the value of type can never contain any self-references, pinning it is useless"
Mind you I'm very new at FFI but I'd like to understand what are the best ways to wrap them into safe Rust.