Skip to main content

PeekableExt

Trait PeekableExt 

Source
pub trait PeekableExt<'a, I: Iterator> {
    // Required method
    fn peek_take_while<P: FnMut(&I::Item) -> bool>(
        &'a mut self,
        predicate: P,
    ) -> PeekTakeWhile<'a, I, P> ;
}

Required Methods§

Source

fn peek_take_while<P: FnMut(&I::Item) -> bool>( &'a mut self, predicate: P, ) -> PeekTakeWhile<'a, I, P>

Returns an iterator that takes elements from the underlying Peekable while the predicate is true. Unlike Iterator::take_while, this iterator does not consume the first element that does not satisfy the predicate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, I: Iterator> PeekableExt<'a, I> for Peekable<I>

Source§

fn peek_take_while<P: FnMut(&I::Item) -> bool>( &'a mut self, predicate: P, ) -> PeekTakeWhile<'a, I, P>

Implementors§