-
Notifications
You must be signed in to change notification settings - Fork 341
expose std::pin #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose std::pin #203
Conversation
The module is not behind the |
Oh yeah accurate; I was thinking |
I'm not that sure we should expose
Defining and calling futures is something users should rarely do (ideally, never!) - after all, the promise of async/await is that we don't write futures by hand anymore. And even if we still do write them by hand from time to time today, I expect that to be less and less the case over time. Another point is that pinning is not that much related to async programming, and is an orthogonal feature that has more to do with generators. But I admit that, practically speaking, pinning is very closely tied to futures right now. There are also use std::marker::PhantomPinned;
use async_std::pin::Pin; Why is |
@stjepang those are all valid points, and I agree. I'll put the whole module behind an unstable flag! |
1e43fe8
to
e9de779
Compare
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
all feedback implemented. bors r+ |
@yoshuawuyts: It seems bors could not recognize your comment as a command. https://bors.tech/documentation/
|
bors r+ |
203: expose std::pin r=yoshuawuyts a=yoshuawuyts This is important when defining / calling futures, so it makes sense for us to also export this. But also given recent user feedback on the confusion on pinning, I'd like to open up the possibility to experiment with providing better pinning facilities such as [`pin-project`](https://github.com/taiki-e/pin-project) or [`pin_mut`](https://docs.rs/pin-utils/0.1.0-alpha.4/pin_utils/macro.pin_mut.html) behind flags. I'm not sure if we could, or even should. But I want to allow us to have that conversation and test things out (even if it's just in floating patches.) Thanks! Co-authored-by: Yoshua Wuyts <[email protected]>
Build succeeded
|
Would it make sense to experiment with I'd love to collect all kinds of nice stuff there like But anyways, just thinking out aloud - let's keep |
@stjepang Hell yes! |
This is important when defining / calling futures, so it makes sense for us to also export this.
But also given recent user feedback on the confusion on pinning, I'd like to open up the possibility to experiment with providing better pinning facilities such as
pin-project
orpin_mut
behind flags. I'm not sure if we could, or even should. But I want to allow us to have that conversation and test things out (even if it's just in floating patches.)Thanks!