4 ms·
> Most Rust users should not have to worry about it. It's one of those things that becomes more of a concern if you're writing library code for low level datast
by laurencerowe 3y ago
> Most Rust users should not have to worry about it. It's one of those things that becomes more of a concern if you're writing library code for low level datastructures, or interfacing with C/C++ libraries.
Don’t all Rust users writing async code have to worry about Pin?
- brigadier132 3y agoNot really, the async libraries hide the implementation details from you. It's an issue for library developers.
- cmrdporcupine 3y agoI've never had to and I have stuff that uses async all over. The only time I've seriously had to deal with Pin is for some pretty low level stuff: manual memory/heap management for database datastructures (paged btree) and for some work stuff related to working with a C++ library that uses zeromq, etc. The point being that in both cases these were frobby dark corners where the mechanics of the pinning ends up being hidden from the user. People writing application code in Rust should not encounter it often.
- hedora 3y agoYou get to avoid pin until you can’t, and then it’s because of some terribly unintuitive advanced usage corner case. For instance, the async_stream crate would be much nicer if you didn’t need to pun_mut! the stream instances it provides: https://docs.rs/async-stream/latest/async_stream/ https://docs.rs/async-stream/latest/async_stream/