Skip to main content

split_when

Function split_when 

Source
pub fn split_when<T, F>(src: Source<T>, pred: F) -> Source<Source<T>>
where T: Send + 'static, F: FnMut(&T) -> bool + Send + 'static,
Expand description

split_when(pred) — split the source into a sequence of substreams; a new substream begins when pred(item) returns true, with the splitting element going to the new substream.