Trait fefix::StreamIterator[][src]

pub trait StreamIterator {
    type Item: ?Sized;
    fn advance(&mut self);
fn get(&self) -> Option<&Self::Item>; fn next(&mut self) -> Option<&Self::Item> { ... }
fn size_hint(&self) -> (usize, Option<usize>) { ... }
fn all<F>(&mut self, mut f: F) -> bool
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... }
fn any<F>(&mut self, mut f: F) -> bool
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... }
fn by_ref(&mut self) -> &mut Self
    where
        Self: Sized
, { ... }
fn chain<I>(self, other: I) -> Chain<Self, I>
    where
        Self: Sized,
        I: StreamIterator<Item = Self::Item> + Sized
, { ... }
fn cloned(self) -> Cloned<Self>
    where
        Self: Sized,
        Self::Item: Clone
, { ... }
fn count(self) -> usize
    where
        Self: Sized
, { ... }
fn filter<F>(self, f: F) -> Filter<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... }
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, B, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> Option<B>
, { ... }
fn flat_map<J, F>(self, f: F) -> FlatMap<Self, J, F>
    where
        Self: Sized,
        J: StreamIterator,
        F: FnMut(&Self::Item) -> J
, { ... }
fn filter_map_deref<B, F>(self, f: F) -> FilterMapDeref<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> Option<B>
, { ... }
fn find<F>(&mut self, mut f: F) -> Option<&Self::Item>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... }
fn fuse(self) -> Fuse<Self>
    where
        Self: Sized
, { ... }
fn inspect<F>(self, f: F) -> Inspect<Self, F>
    where
        F: FnMut(&Self::Item),
        Self: Sized
, { ... }
fn map<B, F>(self, f: F) -> Map<Self, B, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> B
, { ... }
fn map_deref<B, F>(self, f: F) -> MapDeref<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> B
, { ... }
fn map_ref<B: ?Sized, F>(self, f: F) -> MapRef<Self, F>
    where
        Self: Sized,
        F: Fn(&Self::Item) -> &B
, { ... }
fn nth(&mut self, n: usize) -> Option<&Self::Item> { ... }
fn position<F>(&mut self, mut f: F) -> Option<usize>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... }
fn skip(self, n: usize) -> Skip<Self>
    where
        Self: Sized
, { ... }
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... }
fn take(self, n: usize) -> Take<Self>
    where
        Self: Sized
, { ... }
fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... }
fn rev(self) -> Rev<Self>
    where
        Self: Sized + DoubleEndedStreamIterator
, { ... }
fn fold<B, F>(mut self: Self, init: B, mut f: F) -> B
    where
        Self: Sized,
        F: FnMut(B, &Self::Item) -> B
, { ... }
fn for_each<F>(self, mut f: F)
    where
        Self: Sized,
        F: FnMut(&Self::Item)
, { ... } }

An interface for dealing with streaming iterators.

Associated Types

type Item: ?Sized[src]

The type of the elements being iterated over.

Loading content...

Required methods

fn advance(&mut self)[src]

Advances the iterator to the next element.

Iterators start just before the first element, so this should be called before get.

The behavior of calling this method after the end of the iterator has been reached is unspecified.

fn get(&self) -> Option<&Self::Item>[src]

Returns a reference to the current element of the iterator.

The behavior of calling this method before advance has been called is unspecified.

Loading content...

Provided methods

fn next(&mut self) -> Option<&Self::Item>[src]

Advances the iterator and returns the next value.

The behavior of calling this method after the end of the iterator has been reached is unspecified.

The default implementation simply calls advance followed by get.

fn size_hint(&self) -> (usize, Option<usize>)[src]

Returns the bounds on the remaining length of the iterator.

fn all<F>(&mut self, mut f: F) -> bool where
    Self: Sized,
    F: FnMut(&Self::Item) -> bool
[src]

Determines if all elements of the iterator satisfy a predicate.

fn any<F>(&mut self, mut f: F) -> bool where
    Self: Sized,
    F: FnMut(&Self::Item) -> bool
[src]

Determines if any elements of the iterator satisfy a predicate.

fn by_ref(&mut self) -> &mut Self where
    Self: Sized
[src]

Borrows an iterator, rather than consuming it.

This is useful to allow the application of iterator adaptors while still retaining ownership of the original adaptor.

fn chain<I>(self, other: I) -> Chain<Self, I> where
    Self: Sized,
    I: StreamIterator<Item = Self::Item> + Sized
[src]

Consumes two iterators and returns a new iterator that iterates over both in sequence.

fn cloned(self) -> Cloned<Self> where
    Self: Sized,
    Self::Item: Clone
[src]

Produces a normal, non-streaming, iterator by cloning the elements of this iterator.

fn count(self) -> usize where
    Self: Sized
[src]

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
[src]

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>, 
[src]

Creates an iterator which both filters and maps by applying a closure to elements.

fn flat_map<J, F>(self, f: F) -> FlatMap<Self, J, F> where
    Self: Sized,
    J: StreamIterator,
    F: FnMut(&Self::Item) -> J, 
[src]

Creates an iterator which flattens iterators obtained by applying a closure to elements. Note that the returned iterators must be streaming iterators.

fn filter_map_deref<B, F>(self, f: F) -> FilterMapDeref<Self, F> where
    Self: Sized,
    F: FnMut(&Self::Item) -> Option<B>, 
[src]

Creates a regular, non-streaming iterator which both filters and maps by applying a closure to elements.

fn find<F>(&mut self, mut f: F) -> Option<&Self::Item> where
    Self: Sized,
    F: FnMut(&Self::Item) -> bool
[src]

Returns the first element of the iterator that satisfies the predicate.

fn fuse(self) -> Fuse<Self> where
    Self: Sized
[src]

Creates an iterator which is "well behaved" at the beginning and end of iteration.

The behavior of calling get before iteration has been started, and of continuing to call advance after get has returned None is normally unspecified, but this guarantees that get will return None in both cases.

fn inspect<F>(self, f: F) -> Inspect<Self, F> where
    F: FnMut(&Self::Item),
    Self: Sized
[src]

Call a closure on each element, passing the element on. The closure is called upon calls to advance or advance_back, and exactly once per element regardless of how many times (if any) get is called.

fn map<B, F>(self, f: F) -> Map<Self, B, F> where
    Self: Sized,
    F: FnMut(&Self::Item) -> B, 
[src]

Creates an iterator which transforms elements of this iterator by passing them to a closure.

fn map_deref<B, F>(self, f: F) -> MapDeref<Self, F> where
    Self: Sized,
    F: FnMut(&Self::Item) -> B, 
[src]

Creates a regular, non-streaming 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, 
[src]

Creates an iterator which transforms elements of this iterator by passing them to a closure.

Unlike map, this method takes a closure that returns a reference into the original value.

fn nth(&mut self, n: usize) -> Option<&Self::Item>[src]

Consumes the first n elements of the iterator, returning the next one.

fn position<F>(&mut self, mut f: F) -> Option<usize> where
    Self: Sized,
    F: FnMut(&Self::Item) -> bool
[src]

Returns the index of the first element of the iterator matching a predicate.

fn skip(self, n: usize) -> Skip<Self> where
    Self: Sized
[src]

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
[src]

Creates an iterator that skips initial elements matching a predicate.

fn take(self, n: usize) -> Take<Self> where
    Self: Sized
[src]

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
[src]

Creates an iterator which only returns initial elements matching a predicate.

fn rev(self) -> Rev<Self> where
    Self: Sized + DoubleEndedStreamIterator, 
[src]

Creates an iterator which returns elemens in the opposite order.

fn fold<B, F>(mut self: Self, init: B, mut f: F) -> B where
    Self: Sized,
    F: FnMut(B, &Self::Item) -> B, 
[src]

Reduces the iterator's elements to a single, final value.

fn for_each<F>(self, mut f: F) where
    Self: Sized,
    F: FnMut(&Self::Item), 
[src]

Calls a closure on each element of an iterator.

Loading content...

Implementations on Foreign Types

impl<'a, I: ?Sized> StreamIterator for &'a mut I where
    I: StreamIterator
[src]

type Item = I::Item

Loading content...

Implementors

Loading content...