Skip to main content

skip_while

Function skip_while 

Source
pub fn skip_while<T, S, P>(predicate: P, s: S) -> impl Stream<Item = T>
where S: Stream<Item = T>, P: Fn(&T) -> bool,
Expand description

Skips values from a stream while the predicate returns true.

§Note

Prefer using the built-in StreamExt::skip_while() method when chaining:

use futures::StreamExt;
let result = stream.skip_while(|x| futures::future::ready(*x < 3));

This standalone function is provided for functional/pipe-style composition.