rust-lang / futures-rs

Zero-cost asynchronous programming in Rust
https://rust-lang.github.io/futures-rs/
Apache License 2.0
5.4k stars 626 forks source link

`StreamExt::find` method analogous to `Iterator::find`? #2705

Open nullchinchilla opened 1 year ago

nullchinchilla commented 1 year ago

https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find

This is something I've always wanted in Stream-based code. Right now I have to use manual while-loop iteration for anything involving "read from this stream until something you need is found, then stop". The "stop" part also makes it impossible to express with fold and the like.

eredotpkfr commented 4 months ago

Is there any update for this?