Closed
Description
How would a filter example look like, e.g. taking the example from the README yielding only odd numbers based on a source stream?
fn zero_to_three() -> impl Stream<Item = u32> {
stream! {
for i in 0..3 {
yield i;
}
}
}
/// Stream of only odd numbers
fn odds<S: Stream<Item = u32>>(input: S)
-> impl Stream<Item = u32>
{
stream! {
pin_mut!(input);
while let Some(value) = input.next().await {
// ???
}
}
}
Metadata
Metadata
Assignees
Labels
No labels