Closed
Description
Similar to the future::timeout
free function we should add a Stream::timeout
method. This method should be marked as "unstable".
Example
// This example will never actually time out, but you get the idea.
let s = stream::repeat(1u8).take(100);
let s = s.timeout(Duration::from_secs(1));
while let Some(_) = s.next().await {
dbg!();
}