You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use pin_project::pin_project;use core::future::Future;#[pin_project]structPinned<A:Future,B:Future>(#[pin]A,#[pin]B);
But this doesn't:
use pin_project::pin_project;use core::future::Future;#[pin_project]structPinned<A:Future,B:Future>{
futures:(#[pin]A,#[pin]B),}
So instead we now have to do:
use pin_project::pin_project;use core::future::Future;#[pin_project]structFutures<A:Future,B:Future>(#[pin]A,#[pin]B);#[pin_project]structPinned<A:Future,B:Future>{futures:Futures<A,B>,}
We ran into some issues with this in yoshuawuyts/futures-concurrency#74. I'm not sure how feasible this would be to provide, but being able to pin-project into individual enum fields would save us from having to generate an intermediate struct. So I figured I'd raise it here; hope that's alright!
The text was updated successfully, but these errors were encountered:
Another approach is providing a trait for pin projection and implementing it for tuples. This allows the removal of tuple-struct workaround. However, unfortunately, this approach cannot support arbitrarily sized tuples, though.
As mentioned in 1.0.0 tracking issue, this approach needs recently stabilized GAT. Something like the following:
On the other hand, this probably has the advantage of being able to support slices and arrays. (Self::Projection will probably be the iterator instead of slice/array, though.)
The following currently works:
But this doesn't:
So instead we now have to do:
We ran into some issues with this in yoshuawuyts/futures-concurrency#74. I'm not sure how feasible this would be to provide, but being able to pin-project into individual enum fields would save us from having to generate an intermediate struct. So I figured I'd raise it here; hope that's alright!
The text was updated successfully, but these errors were encountered: