Struct streaming_iterator::TakeWhile
[−]
[src]
pub struct TakeWhile<I, F> { /* fields omitted */ }
A streaming iterator which only returns initial elements matching a predicate.
Trait Implementations
impl<I, F> StreamingIterator for TakeWhile<I, F> where I: StreamingIterator, F: FnMut(&I::Item) -> bool
[src]
type Item = I::Item
The type of the elements being iterated over.
fn advance(&mut self)
Advances the iterator to the next element. Read more
fn get(&self) -> Option<&I::Item>
Returns a reference to the current element of the iterator. Read more
fn next(&mut self) -> Option<&I::Item>
Advances the iterator and returns the next value. Read more
fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator.
fn all<F>(&mut self, f: F) -> bool where Self: Sized, F: FnMut(&Self::Item) -> bool
Determines if all elements of the iterator satisfy a predicate.
fn any<F>(&mut self, f: F) -> bool where Self: Sized, F: FnMut(&Self::Item) -> bool
Determines if any elements of the iterator satisfy a predicate.
fn by_ref(&mut self) -> &mut Self where Self: Sized
Borrows an iterator, rather than consuming it. Read more
fn cloned(self) -> Cloned<Self> where Self: Sized, Self::Item: Clone
Produces a normal, non-streaming, iterator by cloning the elements of this iterator.
fn count(self) -> usize where Self: Sized
Consumes the iterator, counting the number of remaining elements and returning it.
fn filter<F>(self, f: F) -> Filter<Self, F> where Self: Sized, F: FnMut(&Self::Item) -> bool
Creates an iterator which uses a closure to determine if an element should be yielded.
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, B, F> where Self: Sized, F: FnMut(&Self::Item) -> Option<B>
Creates an iterator which both filters and maps by applying a closure to elements.
fn find<F>(&mut self, f: F) -> Option<&Self::Item> where Self: Sized, F: FnMut(&Self::Item) -> bool
Returns the first element of the iterator that satisfies the predicate.
fn fuse(self) -> Fuse<Self> where Self: Sized
Creates an iterator which is "well behaved" at the beginning and end of iteration. Read more
fn map<B, F>(self, f: F) -> Map<Self, B, F> where Self: Sized, F: FnMut(&Self::Item) -> B
Creates an iterator which transforms elements of this iterator by passing them to a closure.
fn map_ref<B: ?Sized, F>(self, f: F) -> MapRef<Self, F> where Self: Sized, F: Fn(&Self::Item) -> &B
Creates an iterator which transforms elements of this iterator by passing them to a closure. Read more
fn nth(&mut self, n: usize) -> Option<&Self::Item>
Consumes the first n
elements of the iterator, returning the next one.
fn position<F>(&mut self, f: F) -> Option<usize> where Self: Sized, F: FnMut(&Self::Item) -> bool
Returns the index of the first element of the iterator matching a predicate.
fn skip(self, n: usize) -> Skip<Self> where Self: Sized
Creates an iterator which skips the first n
elements.
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where Self: Sized, F: FnMut(&Self::Item) -> bool
Creates an iterator that skips initial elements matching a predicate.
fn take(self, n: usize) -> Take<Self> where Self: Sized
Creates an iterator which only returns the first n
elements.
fn take_while<F>(self, f: F) -> TakeWhile<Self, F> where Self: Sized, F: FnMut(&Self::Item) -> bool
Creates an iterator which only returns initial elements matching a predicate.