I developed the crate futures-buffered a couple years ago with the intent of being a more efficient 'FuturesUnordered' type than the one in futures_util.
The core of the unsoundness in #182 are the pin-violations caused by FutureGroup slab reallocs. futures-buffered solves this by using a 'triangular array' pattern, where each subsequent realloc is actually a new slab.
Note: the unsoundness still exists in FutureGroup. futures-buffered does not return keys for entries (although that is not a bad idea) so the API is not compatible.
A quick soundness fix for FutureGroup would be to make Stream require F: Unpin, albeit this is a breaking change.
Even if you do not merge this change, I hope it serves as a nice inspiration for you :)
Fixes #182
I developed the crate
futures-buffered
a couple years ago with the intent of being a more efficient 'FuturesUnordered' type than the one infutures_util
.The core of the unsoundness in #182 are the pin-violations caused by FutureGroup slab reallocs.
futures-buffered
solves this by using a 'triangular array' pattern, where each subsequent realloc is actually a new slab.Note: the unsoundness still exists in FutureGroup.
futures-buffered
does not return keys for entries (although that is not a bad idea) so the API is not compatible.A quick soundness fix for FutureGroup would be to make
Stream
requireF: Unpin
, albeit this is a breaking change.Even if you do not merge this change, I hope it serves as a nice inspiration for you :)