-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Consider merging this crate and pin-utils #58
Comments
I agree with you. I submitted rust-lang/futures-rs#1686 for this, but, we can consider redefining in pin-project. |
cc @Nemo157 Any thoughts on this? |
I actually find But, I do agree that it would be good to have a single crate exporting all utilities that you need when working with |
Yeah, I also feel
As long as you look at the code in the tests directory, it looks like it's easy to use... |
The ergonomic API for stack pinning has not been established yet, so if adding these support to And if we want to experiment with ergonomic things, I think it should be done in another library. |
Can we not add pin_mut at a later time or what ever the "ergo" api will be. Don't think I've needed pin_mut where I have pin-project and not futures-util? |
Small update to my comment above, I've now published |
Actually, |
I'm still torn about this. Here are some updates and my opinions (TL;DR: I feel there are one advantage and some relatively minor drawbacks):
|
I've become relatively indifferent about adding |
I'm going closing this because the benefits of doing this don't seem to outweigh the drawbacks I said in the comment above, at this time. If anyone can explain more about the benefits of doing this, we can reopen it. |
The pin-utils crate provides three macros:
pin_mut
,unsafe_pinned
, andunsafe_unpinned
.The
#[pin_project]
attribute provided by this crate is strictly more powerful thanunsafe_pinned
andunsafe_unpinned
- it ensures safety by default, but lets you opt-out viaunsafe
to get the unchecked behavior ofunsafe_pinned
andunsafe_unpinned
.The only thing this crate is missing is the
pin_mut
macro, which is a smallmacro_rules!
macro.I think it would be useful for there to be a single crate which handles all of these pinning operations. Currently, users that want both safe pin projections and stack pinning need to use two separate crates.
The text was updated successfully, but these errors were encountered: