Trait IteratorExt

Source
pub trait IteratorExt: Iterator {
    // Required method
    fn split_when(
        self,
        predicate: impl Fn(&Self::Item) -> bool,
    ) -> (impl Iterator<Item = Self::Item>, Self)
       where Self: Sized;
}

Required Methods§

Source

fn split_when( self, predicate: impl Fn(&Self::Item) -> bool, ) -> (impl Iterator<Item = Self::Item>, Self)
where Self: Sized,

Split the iterator into two parts when the predicate first time turns true.

The first part is the part before the predicate is true. The second part is the part after the predicate is true.

Implementors§