Trait traverse::Traversal [] [src]

pub trait Traversal: Sized {
    type Item;
    fn foreach<F>(self, F) where F: FnMut(Self::Item) -> bool;

    fn run<F>(self, f: F) where F: FnMut(Self::Item) { ... }
    fn size_hint(&self) -> (usize, Option<usize>) { ... }
    fn map<F, O>(self, f: F) -> Map<Self, F> where F: FnMut(Self::Item) -> O { ... }
    fn filter<F>(self, pred: F) -> Filter<Self, F> where F: FnMut(&Self::Item) -> bool { ... }
    fn filter_map<F, O>(self, pred: F) -> FilterMap<Self, F> where F: FnMut(Self::Item) -> Option<O> { ... }
    fn enumerate(self) -> Enumerate<Self> { ... }
    fn skip(self, n: usize) -> Skip<Self> { ... }
    fn take(self, n: usize) -> Take<Self> { ... }
    fn skip_while<F>(self, pred: F) -> SkipWhile<Self, F> where F: FnMut(&Self::Item) -> bool { ... }
    fn take_while<F>(self, pred: F) -> TakeWhile<Self, F> where F: FnMut(&Self::Item) -> bool { ... }
    fn inspect<F>(self, f: F) -> Inspect<Self, F> where F: FnMut(&Self::Item) { ... }
    fn flat_map<A, U, F>(self, f: F) -> FlatMap<Self, F> where U: Traversal<Item=A>, F: FnMut(Self::Item) -> U { ... }
    fn chain<O>(self, other: O) -> Chain<Self, O> where O: Traversal<Item=Self::Item> { ... }
    fn count(self) -> usize { ... }
    fn cloned(self) -> Cloned<Self> { ... }
    fn collect<D>(self) -> D where D: FromTraversal<Self::Item> { ... }
}

An iterator that runs all at once

Associated Types

type Item

Required Methods

fn foreach<F>(self, F) where F: FnMut(Self::Item) -> bool

Run this Iterator using the provided closure.

Return true from the closure to end the iteration.

Provided Methods

fn run<F>(self, f: F) where F: FnMut(Self::Item)

Run this Iterator using the provided closure.

This is a utility method for non-cancelling iterations.

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

fn map<F, O>(self, f: F) -> Map<Self, F> where F: FnMut(Self::Item) -> O

fn filter<F>(self, pred: F) -> Filter<Self, F> where F: FnMut(&Self::Item) -> bool

fn filter_map<F, O>(self, pred: F) -> FilterMap<Self, F> where F: FnMut(Self::Item) -> Option<O>

fn enumerate(self) -> Enumerate<Self>

fn skip(self, n: usize) -> Skip<Self>

fn take(self, n: usize) -> Take<Self>

fn skip_while<F>(self, pred: F) -> SkipWhile<Self, F> where F: FnMut(&Self::Item) -> bool

fn take_while<F>(self, pred: F) -> TakeWhile<Self, F> where F: FnMut(&Self::Item) -> bool

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

fn flat_map<A, U, F>(self, f: F) -> FlatMap<Self, F> where U: Traversal<Item=A>, F: FnMut(Self::Item) -> U

fn chain<O>(self, other: O) -> Chain<Self, O> where O: Traversal<Item=Self::Item>

fn count(self) -> usize

fn cloned(self) -> Cloned<Self>

fn collect<D>(self) -> D where D: FromTraversal<Self::Item>

Implementors