futures-rs
futures-rs copied to clipboard
Generalize chunks/ready_chunks/try_chunks/etc to collect into T: Extend, not just Vec
In particular I would find it really useful to be able to ready_chunks a Stream of Futures into FuturesOrdereds and spawn them on a threadpool to parallelize my computation.
This would be a breaking change of course.
Seems reasonable to me.
This is actually a bit harder than I thought. Ideally there would be traits for with_capacity
and len
too so that we can reserve space in the collection and not have to track the collection's size again ourselves in Chunks
.
There is extend_reserve
on nightly.
Yeah people don't seem eager to stabilize it though, and there's nothing at all for len
.