Trait enso_prelude::iter::DoubleEndedIterator1.0.0[][src]

pub trait DoubleEndedIterator: Iterator {
    fn next_back(&mut self) -> Option<Self::Item>;

    fn advance_back_by(&mut self, n: usize) -> Result<(), usize> { ... }
fn nth_back(&mut self, n: usize) -> Option<Self::Item> { ... }
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
    where
        R: Try<Ok = B>,
        F: FnMut(B, Self::Item) -> R
, { ... }
fn rfold<B, F>(self, init: B, f: F) -> B
    where
        F: FnMut(B, Self::Item) -> B
, { ... }
fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
    where
        P: FnMut(&Self::Item) -> bool
, { ... } }
Expand description

An iterator able to yield elements from both ends.

Something that implements DoubleEndedIterator has one extra capability over something that implements Iterator: the ability to also take Items from the back, as well as the front.

It is important to note that both back and forth work on the same range, and do not cross: iteration is over when they meet in the middle.

In a similar fashion to the Iterator protocol, once a DoubleEndedIterator returns None from a next_back(), calling it again may or may not ever return Some again. next() and next_back() are interchangeable for this purpose.

Examples

Basic usage:

let numbers = vec![1, 2, 3, 4, 5, 6];

let mut iter = numbers.iter();

assert_eq!(Some(&1), iter.next());
assert_eq!(Some(&6), iter.next_back());
assert_eq!(Some(&5), iter.next_back());
assert_eq!(Some(&2), iter.next());
assert_eq!(Some(&3), iter.next());
assert_eq!(Some(&4), iter.next());
assert_eq!(None, iter.next());
assert_eq!(None, iter.next_back());

Required methods

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

Expand description

Removes and returns an element from the end of the iterator.

Returns None when there are no more elements.

The trait-level docs contain more details.

Examples

Basic usage:

let numbers = vec![1, 2, 3, 4, 5, 6];

let mut iter = numbers.iter();

assert_eq!(Some(&1), iter.next());
assert_eq!(Some(&6), iter.next_back());
assert_eq!(Some(&5), iter.next_back());
assert_eq!(Some(&2), iter.next());
assert_eq!(Some(&3), iter.next());
assert_eq!(Some(&4), iter.next());
assert_eq!(None, iter.next());
assert_eq!(None, iter.next_back());

Remarks

The elements yielded by DoubleEndedIterator’s methods may differ from the ones yielded by Iterator’s methods:

let vec = vec![(1, 'a'), (1, 'b'), (1, 'c'), (2, 'a'), (2, 'b')];
let uniq_by_fst_comp = || {
    let mut seen = std::collections::HashSet::new();
    vec.iter().copied().filter(move |x| seen.insert(x.0))
};

assert_eq!(uniq_by_fst_comp().last(), Some((2, 'a')));
assert_eq!(uniq_by_fst_comp().next_back(), Some((2, 'b')));

assert_eq!(
    uniq_by_fst_comp().fold(vec![], |mut v, x| {v.push(x); v}),
    vec![(1, 'a'), (2, 'a')]
);
assert_eq!(
    uniq_by_fst_comp().rfold(vec![], |mut v, x| {v.push(x); v}),
    vec![(2, 'b'), (1, 'c')]
);
Loading content...

Provided methods

fn advance_back_by(&mut self, n: usize) -> Result<(), usize>[src]

🔬 This is a nightly-only experimental API. (iter_advance_by)

recently added

Expand description

Advances the iterator from the back by n elements.

advance_back_by is the reverse version of advance_by. This method will eagerly skip n elements starting from the back by calling next_back up to n times until None is encountered.

advance_back_by(n) will return Ok(()) if the iterator successfully advances by n elements, or Err(k) if None is encountered, where k is the number of elements the iterator is advanced by before running out of elements (i.e. the length of the iterator). Note that k is always less than n.

Calling advance_back_by(0) does not consume any elements and always returns Ok(()).

Examples

Basic usage:

#![feature(iter_advance_by)]

let a = [3, 4, 5, 6];
let mut iter = a.iter();

assert_eq!(iter.advance_back_by(2), Ok(()));
assert_eq!(iter.next_back(), Some(&4));
assert_eq!(iter.advance_back_by(0), Ok(()));
assert_eq!(iter.advance_back_by(100), Err(1)); // only `&3` was skipped

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

Expand description

Returns the nth element from the end of the iterator.

This is essentially the reversed version of Iterator::nth(). Although like most indexing operations, the count starts from zero, so nth_back(0) returns the first value from the end, nth_back(1) the second, and so on.

Note that all elements between the end and the returned element will be consumed, including the returned element. This also means that calling nth_back(0) multiple times on the same iterator will return different elements.

nth_back() will return None if n is greater than or equal to the length of the iterator.

Examples

Basic usage:

let a = [1, 2, 3];
assert_eq!(a.iter().nth_back(2), Some(&1));

Calling nth_back() multiple times doesn’t rewind the iterator:

let a = [1, 2, 3];

let mut iter = a.iter();

assert_eq!(iter.nth_back(1), Some(&2));
assert_eq!(iter.nth_back(1), None);

Returning None if there are less than n + 1 elements:

let a = [1, 2, 3];
assert_eq!(a.iter().nth_back(10), None);

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
    R: Try<Ok = B>,
    F: FnMut(B, Self::Item) -> R, 
1.27.0[src]

Expand description

This is the reverse version of Iterator::try_fold(): it takes elements starting from the back of the iterator.

Examples

Basic usage:

let a = ["1", "2", "3"];
let sum = a.iter()
    .map(|&s| s.parse::<i32>())
    .try_rfold(0, |acc, x| x.and_then(|y| Ok(acc + y)));
assert_eq!(sum, Ok(6));

Short-circuiting:

let a = ["1", "rust", "3"];
let mut it = a.iter();
let sum = it
    .by_ref()
    .map(|&s| s.parse::<i32>())
    .try_rfold(0, |acc, x| x.and_then(|y| Ok(acc + y)));
assert!(sum.is_err());

// Because it short-circuited, the remaining elements are still
// available through the iterator.
assert_eq!(it.next_back(), Some(&"1"));

fn rfold<B, F>(self, init: B, f: F) -> B where
    F: FnMut(B, Self::Item) -> B, 
1.27.0[src]

Expand description

An iterator method that reduces the iterator’s elements to a single, final value, starting from the back.

This is the reverse version of Iterator::fold(): it takes elements starting from the back of the iterator.

rfold() takes two arguments: an initial value, and a closure with two arguments: an ‘accumulator’, and an element. The closure returns the value that the accumulator should have for the next iteration.

The initial value is the value the accumulator will have on the first call.

After applying this closure to every element of the iterator, rfold() returns the accumulator.

This operation is sometimes called ‘reduce’ or ‘inject’.

Folding is useful whenever you have a collection of something, and want to produce a single value from it.

Examples

Basic usage:

let a = [1, 2, 3];

// the sum of all of the elements of a
let sum = a.iter()
           .rfold(0, |acc, &x| acc + x);

assert_eq!(sum, 6);

This example builds a string, starting with an initial value and continuing with each element from the back until the front:

let numbers = [1, 2, 3, 4, 5];

let zero = "0".to_string();

let result = numbers.iter().rfold(zero, |acc, &x| {
    format!("({} + {})", x, acc)
});

assert_eq!(result, "(1 + (2 + (3 + (4 + (5 + 0)))))");

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item> where
    P: FnMut(&Self::Item) -> bool
1.27.0[src]

Expand description

Searches for an element of an iterator from the back that satisfies a predicate.

rfind() takes a closure that returns true or false. It applies this closure to each element of the iterator, starting at the end, and if any of them return true, then rfind() returns Some(element). If they all return false, it returns None.

rfind() is short-circuiting; in other words, it will stop processing as soon as the closure returns true.

Because rfind() takes a reference, and many iterators iterate over references, this leads to a possibly confusing situation where the argument is a double reference. You can see this effect in the examples below, with &&x.

Examples

Basic usage:

let a = [1, 2, 3];

assert_eq!(a.iter().rfind(|&&x| x == 2), Some(&2));

assert_eq!(a.iter().rfind(|&&x| x == 5), None);

Stopping at the first true:

let a = [1, 2, 3];

let mut iter = a.iter();

assert_eq!(iter.rfind(|&&x| x == 2), Some(&2));

// we can still use `iter`, as there are more elements.
assert_eq!(iter.next_back(), Some(&1));
Loading content...

Implementations on Foreign Types

impl<'a> DoubleEndedIterator for Components<'a>[src]

pub fn next_back(&mut self) -> Option<Component<'a>>[src]

impl<'a> DoubleEndedIterator for Iter<'a>[src]

pub fn next_back(&mut self) -> Option<&'a OsStr>[src]

impl DoubleEndedIterator for ArgsOs[src]

pub fn next_back(&mut self) -> Option<OsString>[src]

impl DoubleEndedIterator for Args[src]

pub fn next_back(&mut self) -> Option<String>[src]

impl<'a> DoubleEndedIterator for EscapeAscii<'a>[src]

pub fn next_back(&mut self) -> Option<u8>[src]

impl<'a, P> DoubleEndedIterator for RSplit<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a, A> DoubleEndedIterator for Iter<'a, A>[src]

pub fn next_back(&mut self) -> Option<&'a A>[src]

impl<'a, P> DoubleEndedIterator for SplitTerminator<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a> DoubleEndedIterator for LinesAny<'a>[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a, T> DoubleEndedIterator for Iter<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a T>[src]

impl<'a, T, P> DoubleEndedIterator for SplitInclusiveMut<'a, T, P> where
    P: FnMut(&T) -> bool
[src]

pub fn next_back(&mut self) -> Option<&'a mut [T]>[src]

impl<'a, P> DoubleEndedIterator for SplitInclusive<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<T, const N: usize> DoubleEndedIterator for IntoIter<T, N>[src]

pub fn next_back(&mut self) -> Option<<IntoIter<T, N> as Iterator>::Item>[src]

impl<T> DoubleEndedIterator for IntoIter<T>[src]

pub fn next_back(&mut self) -> Option<T>[src]

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

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

pub fn advance_back_by(&mut self, n: usize) -> Result<(), usize>[src]

🔬 This is a nightly-only experimental API. (iter_advance_by)

recently added

pub fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item>[src]

impl<'a> DoubleEndedIterator for Chars<'a>[src]

pub fn next_back(&mut self) -> Option<char>[src]

impl<'a, P> DoubleEndedIterator for RMatches<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a, P> DoubleEndedIterator for Split<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a> DoubleEndedIterator for CharIndices<'a>[src]

pub fn next_back(&mut self) -> Option<(usize, char)>[src]

impl<'a> DoubleEndedIterator for Lines<'a>[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a> DoubleEndedIterator for SplitWhitespace<'a>[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a> DoubleEndedIterator for SplitAsciiWhitespace<'a>[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a, T> DoubleEndedIterator for IterMut<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a mut T>[src]

impl<'a, P> DoubleEndedIterator for MatchIndices<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<(usize, &'a str)>[src]

impl<'a, P> DoubleEndedIterator for Matches<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a, P> DoubleEndedIterator for RMatchIndices<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<(usize, &'a str)>[src]

impl<'a, T, P> DoubleEndedIterator for SplitInclusive<'a, T, P> where
    P: FnMut(&T) -> bool
[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

impl<'a, A> DoubleEndedIterator for IterMut<'a, A>[src]

pub fn next_back(&mut self) -> Option<&'a mut A>[src]

impl DoubleEndedIterator for EscapeDefault[src]

pub fn next_back(&mut self) -> Option<u8>[src]

impl<A> DoubleEndedIterator for IntoIter<A>[src]

pub fn next_back(&mut self) -> Option<A>[src]

impl<'_> DoubleEndedIterator for Bytes<'_>[src]

pub fn next_back(&mut self) -> Option<u8>[src]

pub fn nth_back(&mut self, n: usize) -> Option<<Bytes<'_> as Iterator>::Item>[src]

pub fn rfind<P>(
    &mut self,
    predicate: P
) -> Option<<Bytes<'_> as Iterator>::Item> where
    P: FnMut(&<Bytes<'_> as Iterator>::Item) -> bool
[src]

impl<'a, P> DoubleEndedIterator for RSplitTerminator<'a, P> where
    P: Pattern<'a>,
    <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>, 
[src]

pub fn next_back(&mut self) -> Option<&'a str>[src]

impl<'a, T> DoubleEndedIterator for IterMut<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a mut T>[src]

impl<'a, K, V> DoubleEndedIterator for RangeMut<'a, K, V>[src]

pub fn next_back(&mut self) -> Option<(&'a K, &'a mut V)>[src]

impl<T> DoubleEndedIterator for IntoIter<T>[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<K, V> DoubleEndedIterator for IntoIter<K, V>[src]

pub fn next_back(&mut self) -> Option<(K, V)>[src]

impl<T> DoubleEndedIterator for IntoIter<T>[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<'_, T> DoubleEndedIterator for Drain<'_, T>[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<K, V> DoubleEndedIterator for IntoKeys<K, V>[src]

pub fn next_back(&mut self) -> Option<K>[src]

impl<'a, T> DoubleEndedIterator for Iter<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a T>[src]

pub fn rfold<Acc, F>(self, accum: Acc, f: F) -> Acc where
    F: FnMut(Acc, <Iter<'a, T> as Iterator>::Item) -> Acc, 
[src]

pub fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
    R: Try<Ok = B>,
    F: FnMut(B, <Iter<'a, T> as Iterator>::Item) -> R,
    Iter<'a, T>: Sized
[src]

impl<'_, T> DoubleEndedIterator for Drain<'_, T>[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<'_, I, A> DoubleEndedIterator for Splice<'_, I, A> where
    I: Iterator,
    A: Allocator
[src]

pub fn next_back(&mut self) -> Option<<Splice<'_, I, A> as Iterator>::Item>[src]

impl<'a, T> DoubleEndedIterator for Iter<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a T>[src]

impl<'a, K, V> DoubleEndedIterator for ValuesMut<'a, K, V>[src]

pub fn next_back(&mut self) -> Option<&'a mut V>[src]

impl<'_> DoubleEndedIterator for Drain<'_>[src]

pub fn next_back(&mut self) -> Option<char>[src]

impl<'a, T> DoubleEndedIterator for Iter<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a T>[src]

impl<T> DoubleEndedIterator for IntoIter<T>[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<K, V> DoubleEndedIterator for IntoValues<K, V>[src]

pub fn next_back(&mut self) -> Option<V>[src]

impl<'_, T, A> DoubleEndedIterator for Drain<'_, T, A> where
    A: Allocator
[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<T> DoubleEndedIterator for IntoIter<T>[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<T, A> DoubleEndedIterator for IntoIter<T, A> where
    A: Allocator
[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<'a, K, V> DoubleEndedIterator for Keys<'a, K, V>[src]

pub fn next_back(&mut self) -> Option<&'a K>[src]

impl<'a, T> DoubleEndedIterator for Iter<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a T>[src]

impl<'a, K, V> DoubleEndedIterator for IterMut<'a, K, V> where
    K: 'a,
    V: 'a, 
[src]

pub fn next_back(&mut self) -> Option<(&'a K, &'a mut V)>[src]

impl<'a, T> DoubleEndedIterator for Range<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a T>[src]

impl<'a, T> DoubleEndedIterator for IterMut<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a mut T>[src]

pub fn rfold<Acc, F>(self, accum: Acc, f: F) -> Acc where
    F: FnMut(Acc, <IterMut<'a, T> as Iterator>::Item) -> Acc, 
[src]

impl<I, A> DoubleEndedIterator for Box<I, A> where
    I: DoubleEndedIterator + ?Sized,
    A: Allocator
[src]

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

pub fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item>[src]

impl<'a, K, V> DoubleEndedIterator for Values<'a, K, V>[src]

pub fn next_back(&mut self) -> Option<&'a V>[src]

impl<'a, K, V> DoubleEndedIterator for Iter<'a, K, V> where
    K: 'a,
    V: 'a, 
[src]

pub fn next_back(&mut self) -> Option<(&'a K, &'a V)>[src]

impl<'a, K, V> DoubleEndedIterator for Range<'a, K, V>[src]

pub fn next_back(&mut self) -> Option<(&'a K, &'a V)>[src]

impl<'a, T> DoubleEndedIterator for Drain<'a, T> where
    T: 'a + Array
[src]

pub fn next_back(&mut self) -> Option<<T as Array>::Item>[src]

impl<A> DoubleEndedIterator for IntoIter<A> where
    A: Array
[src]

pub fn next_back(&mut self) -> Option<<A as Array>::Item>[src]

impl<X, Iter, D, E, F, G, H> DoubleEndedIterator for ConsTuples<Iter, ((D, E, F, G, H), X)> where
    Iter: DoubleEndedIterator<Item = ((D, E, F, G, H), X)>, 
[src]

pub fn next_back(
    &mut self
) -> Option<<ConsTuples<Iter, ((D, E, F, G, H), X)> as Iterator>::Item>
[src]

impl<T, U> DoubleEndedIterator for ZipLongest<T, U> where
    T: DoubleEndedIterator + ExactSizeIterator,
    U: DoubleEndedIterator + ExactSizeIterator
[src]

pub fn next_back(&mut self) -> Option<<ZipLongest<T, U> as Iterator>::Item>[src]

impl<I> DoubleEndedIterator for RcIter<I> where
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

impl<I, F> DoubleEndedIterator for Update<I, F> where
    F: FnMut(&mut <I as Iterator>::Item),
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<Update<I, F> as Iterator>::Item>[src]

impl<X, Iter, E, F, G, H> DoubleEndedIterator for ConsTuples<Iter, ((E, F, G, H), X)> where
    Iter: DoubleEndedIterator<Item = ((E, F, G, H), X)>, 
[src]

pub fn next_back(
    &mut self
) -> Option<<ConsTuples<Iter, ((E, F, G, H), X)> as Iterator>::Item>
[src]

impl<X, Iter, B, C, D, E, F, G, H> DoubleEndedIterator for ConsTuples<Iter, ((B, C, D, E, F, G, H), X)> where
    Iter: DoubleEndedIterator<Item = ((B, C, D, E, F, G, H), X)>, 
[src]

pub fn next_back(
    &mut self
) -> Option<<ConsTuples<Iter, ((B, C, D, E, F, G, H), X)> as Iterator>::Item>
[src]

impl<I, F> DoubleEndedIterator for Positions<I, F> where
    F: FnMut(<I as Iterator>::Item) -> bool,
    I: DoubleEndedIterator + ExactSizeIterator
[src]

pub fn next_back(&mut self) -> Option<<Positions<I, F> as Iterator>::Item>[src]

impl<I, F> DoubleEndedIterator for PadUsing<I, F> where
    F: FnMut(usize) -> <I as Iterator>::Item,
    I: DoubleEndedIterator + ExactSizeIterator
[src]

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

impl<I, R> DoubleEndedIterator for MapInto<I, R> where
    I: DoubleEndedIterator,
    <I as Iterator>::Item: Into<R>, 
[src]

pub fn next_back(&mut self) -> Option<<MapInto<I, R> as Iterator>::Item>[src]

impl<A> DoubleEndedIterator for RepeatN<A> where
    A: Clone
[src]

pub fn next_back(&mut self) -> Option<<RepeatN<A> as Iterator>::Item>[src]

impl<X, Iter, F, G, H> DoubleEndedIterator for ConsTuples<Iter, ((F, G, H), X)> where
    Iter: DoubleEndedIterator<Item = ((F, G, H), X)>, 
[src]

pub fn next_back(
    &mut self
) -> Option<<ConsTuples<Iter, ((F, G, H), X)> as Iterator>::Item>
[src]

impl<X, Iter, C, D, E, F, G, H> DoubleEndedIterator for ConsTuples<Iter, ((C, D, E, F, G, H), X)> where
    Iter: DoubleEndedIterator<Item = ((C, D, E, F, G, H), X)>, 
[src]

pub fn next_back(
    &mut self
) -> Option<<ConsTuples<Iter, ((C, D, E, F, G, H), X)> as Iterator>::Item>
[src]

impl<X, Iter, G, H> DoubleEndedIterator for ConsTuples<Iter, ((G, H), X)> where
    Iter: DoubleEndedIterator<Item = ((G, H), X)>, 
[src]

pub fn next_back(
    &mut self
) -> Option<<ConsTuples<Iter, ((G, H), X)> as Iterator>::Item>
[src]

impl<L, R> DoubleEndedIterator for Either<L, R> where
    R: DoubleEndedIterator<Item = <L as Iterator>::Item>,
    L: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<Either<L, R> as Iterator>::Item>[src]

impl<A> DoubleEndedIterator for RangeInclusive<A> where
    A: Sub<A, Output = A> + Integer + Clone + ToPrimitive
[src]

pub fn next_back(&mut self) -> Option<A>[src]

impl<A> DoubleEndedIterator for Range<A> where
    A: Integer + Clone + ToPrimitive
[src]

Integer is required to ensure the range will be the same regardless of the direction it is consumed.

pub fn next_back(&mut self) -> Option<A>[src]

impl<'a> DoubleEndedIterator for ArrayIter<'a>[src]

pub fn next_back(&mut self) -> Option<<ArrayIter<'a> as Iterator>::Item>[src]

impl<T, N> DoubleEndedIterator for GenericArrayIter<T, N> where
    N: ArrayLength<T>, 

pub fn next_back(&mut self) -> Option<T>

pub fn rfold<B, F>(self, init: B, f: F) -> B where
    F: FnMut(B, <GenericArrayIter<T, N> as Iterator>::Item) -> B, 

Loading content...

Implementors

impl<'a, I, T> DoubleEndedIterator for Cloned<I> where
    T: 'a + Clone,
    I: DoubleEndedIterator<Item = &'a T>, 
1.1.0[src]

pub fn next_back(&mut self) -> Option<T>[src]

pub fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
    R: Try<Ok = B>,
    F: FnMut(B, <Cloned<I> as Iterator>::Item) -> R,
    Cloned<I>: Sized
[src]

pub fn rfold<Acc, F>(self, init: Acc, f: F) -> Acc where
    F: FnMut(Acc, <Cloned<I> as Iterator>::Item) -> Acc, 
[src]

impl<'a, I, T> DoubleEndedIterator for Copied<I> where
    T: 'a + Copy,
    I: DoubleEndedIterator<Item = &'a T>, 
1.36.0[src]

pub fn next_back(&mut self) -> Option<T>[src]

pub fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
    R: Try<Ok = B>,
    F: FnMut(B, <Copied<I> as Iterator>::Item) -> R,
    Copied<I>: Sized
[src]

pub fn rfold<Acc, F>(self, init: Acc, f: F) -> Acc where
    F: FnMut(Acc, <Copied<I> as Iterator>::Item) -> Acc, 
[src]

impl<'a, T> DoubleEndedIterator for Chunks<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<Chunks<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for ChunksExact<'a, T>1.31.0[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<ChunksExact<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for ChunksExactMut<'a, T>1.31.0[src]

pub fn next_back(&mut self) -> Option<&'a mut [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<ChunksExactMut<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for ChunksMut<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a mut [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<ChunksMut<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for enso_prelude::slice::Iter<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a T>[src]

pub fn nth_back(&mut self, n: usize) -> Option<&'a T>[src]

impl<'a, T> DoubleEndedIterator for enso_prelude::slice::IterMut<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a mut T>[src]

pub fn nth_back(&mut self, n: usize) -> Option<&'a mut T>[src]

impl<'a, T> DoubleEndedIterator for RChunks<'a, T>1.31.0[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<RChunks<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for RChunksExact<'a, T>1.31.0[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<RChunksExact<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for RChunksExactMut<'a, T>1.31.0[src]

pub fn next_back(&mut self) -> Option<&'a mut [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<RChunksExactMut<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for RChunksMut<'a, T>1.31.0[src]

pub fn next_back(&mut self) -> Option<&'a mut [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<RChunksMut<'a, T> as Iterator>::Item>
[src]

impl<'a, T> DoubleEndedIterator for Windows<'a, T>[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<Windows<'a, T> as Iterator>::Item>
[src]

impl<'a, T, P> DoubleEndedIterator for GroupBy<'a, T, P> where
    T: 'a,
    P: FnMut(&T, &T) -> bool
[src]

pub fn next_back(&mut self) -> Option<<GroupBy<'a, T, P> as Iterator>::Item>[src]

impl<'a, T, P> DoubleEndedIterator for GroupByMut<'a, T, P> where
    T: 'a,
    P: FnMut(&T, &T) -> bool
[src]

pub fn next_back(&mut self) -> Option<<GroupByMut<'a, T, P> as Iterator>::Item>[src]

impl<'a, T, P> DoubleEndedIterator for enso_prelude::slice::RSplit<'a, T, P> where
    P: FnMut(&T) -> bool
1.27.0[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

impl<'a, T, P> DoubleEndedIterator for RSplitMut<'a, T, P> where
    P: FnMut(&T) -> bool
1.27.0[src]

pub fn next_back(&mut self) -> Option<&'a mut [T]>[src]

impl<'a, T, P> DoubleEndedIterator for enso_prelude::slice::Split<'a, T, P> where
    P: FnMut(&T) -> bool
[src]

pub fn next_back(&mut self) -> Option<&'a [T]>[src]

impl<'a, T, P> DoubleEndedIterator for SplitMut<'a, T, P> where
    P: FnMut(&T) -> bool
[src]

pub fn next_back(&mut self) -> Option<&'a mut [T]>[src]

impl<'a, T, const N: usize> DoubleEndedIterator for ArrayChunks<'a, T, N>[src]

pub fn next_back(&mut self) -> Option<&'a [T; N]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<ArrayChunks<'a, T, N> as Iterator>::Item>
[src]

impl<'a, T, const N: usize> DoubleEndedIterator for ArrayChunksMut<'a, T, N>[src]

pub fn next_back(&mut self) -> Option<&'a mut [T; N]>[src]

pub fn nth_back(
    &mut self,
    n: usize
) -> Option<<ArrayChunksMut<'a, T, N> as Iterator>::Item>
[src]

impl<'a, T, const N: usize> DoubleEndedIterator for ArrayWindows<'a, T, N>[src]

pub fn next_back(&mut self) -> Option<&'a [T; N]>[src]

pub fn nth_back(&mut self, n: usize) -> Option<&'a [T; N]>[src]

impl<A> DoubleEndedIterator for enso_prelude::Range<A> where
    A: Step
[src]

pub fn next_back(&mut self) -> Option<A>[src]

pub fn nth_back(&mut self, n: usize) -> Option<A>[src]

impl<A> DoubleEndedIterator for enso_prelude::RangeInclusive<A> where
    A: Step
1.26.0[src]

pub fn next_back(&mut self) -> Option<A>[src]

pub fn nth_back(&mut self, n: usize) -> Option<A>[src]

pub fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
    R: Try<Ok = B>,
    F: FnMut(B, <RangeInclusive<A> as Iterator>::Item) -> R,
    RangeInclusive<A>: Sized
[src]

pub fn rfold<B, F>(self, init: B, f: F) -> B where
    F: FnMut(B, <RangeInclusive<A> as Iterator>::Item) -> B,
    RangeInclusive<A>: Sized
[src]

impl<A> DoubleEndedIterator for Repeat<A> where
    A: Clone
[src]

pub fn next_back(&mut self) -> Option<A>[src]

impl<A, B> DoubleEndedIterator for Chain<A, B> where
    A: DoubleEndedIterator,
    B: DoubleEndedIterator<Item = <A as Iterator>::Item>, 
[src]

pub fn next_back(&mut self) -> Option<<A as Iterator>::Item>[src]

pub fn advance_back_by(&mut self, n: usize) -> Result<(), usize>[src]

🔬 This is a nightly-only experimental API. (iter_advance_by)

recently added

pub fn nth_back(&mut self, n: usize) -> Option<<Chain<A, B> as Iterator>::Item>[src]

pub fn rfind<P>(
    &mut self,
    predicate: P
) -> Option<<Chain<A, B> as Iterator>::Item> where
    P: FnMut(&<Chain<A, B> as Iterator>::Item) -> bool
[src]

pub fn try_rfold<Acc, F, R>(&mut self, acc: Acc, f: F) -> R where
    R: Try<Ok = Acc>,
    F: FnMut(Acc, <Chain<A, B> as Iterator>::Item) -> R,
    Chain<A, B>: Sized
[src]

pub fn rfold<Acc, F>(self, acc: Acc, f: F) -> Acc where
    F: FnMut(Acc, <Chain<A, B> as Iterator>::Item) -> Acc, 
[src]

impl<A, B> DoubleEndedIterator for Zip<A, B> where
    A: DoubleEndedIterator + ExactSizeIterator,
    B: DoubleEndedIterator + ExactSizeIterator
[src]

pub fn next_back(
    &mut self
) -> Option<(<A as Iterator>::Item, <B as Iterator>::Item)>
[src]

impl<A, F> DoubleEndedIterator for OnceWith<F> where
    F: FnOnce() -> A, 
1.43.0[src]

pub fn next_back(&mut self) -> Option<A>[src]

impl<B, I, F> DoubleEndedIterator for FilterMap<I, F> where
    F: FnMut(<I as Iterator>::Item) -> Option<B>,
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<B>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <FilterMap<I, F> as Iterator>::Item) -> R,
    FilterMap<I, F>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <FilterMap<I, F> as Iterator>::Item) -> Acc, 
[src]

impl<B, I, F> DoubleEndedIterator for Map<I, F> where
    F: FnMut(<I as Iterator>::Item) -> B,
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<B>[src]

pub fn try_rfold<Acc, G, R>(&mut self, init: Acc, g: G) -> R where
    R: Try<Ok = Acc>,
    G: FnMut(Acc, <Map<I, F> as Iterator>::Item) -> R,
    Map<I, F>: Sized
[src]

pub fn rfold<Acc, G>(self, init: Acc, g: G) -> Acc where
    G: FnMut(Acc, <Map<I, F> as Iterator>::Item) -> Acc, 
[src]

impl<I> DoubleEndedIterator for Enumerate<I> where
    I: ExactSizeIterator + DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<(usize, <I as Iterator>::Item)>[src]

pub fn nth_back(&mut self, n: usize) -> Option<(usize, <I as Iterator>::Item)>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <Enumerate<I> as Iterator>::Item) -> R,
    Enumerate<I>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Enumerate<I> as Iterator>::Item) -> Acc, 
[src]

impl<I> DoubleEndedIterator for Fuse<I> where
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

pub fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, acc: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <Fuse<I> as Iterator>::Item) -> R,
    Fuse<I>: Sized
[src]

pub fn rfold<Acc, Fold>(self, acc: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Fuse<I> as Iterator>::Item) -> Acc, 
[src]

pub fn rfind<P>(&mut self, predicate: P) -> Option<<Fuse<I> as Iterator>::Item> where
    P: FnMut(&<Fuse<I> as Iterator>::Item) -> bool
[src]

impl<I> DoubleEndedIterator for Peekable<I> where
    I: DoubleEndedIterator
1.38.0[src]

pub fn next_back(&mut self) -> Option<<Peekable<I> as Iterator>::Item>[src]

pub fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
    R: Try<Ok = B>,
    F: FnMut(B, <Peekable<I> as Iterator>::Item) -> R,
    Peekable<I>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Peekable<I> as Iterator>::Item) -> Acc, 
[src]

impl<I> DoubleEndedIterator for Rev<I> where
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

pub fn advance_back_by(&mut self, n: usize) -> Result<(), usize>[src]

🔬 This is a nightly-only experimental API. (iter_advance_by)

recently added

pub fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item>[src]

pub fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
    R: Try<Ok = B>,
    F: FnMut(B, <Rev<I> as Iterator>::Item) -> R,
    Rev<I>: Sized
[src]

pub fn rfold<Acc, F>(self, init: Acc, f: F) -> Acc where
    F: FnMut(Acc, <Rev<I> as Iterator>::Item) -> Acc, 
[src]

pub fn rfind<P>(&mut self, predicate: P) -> Option<<Rev<I> as Iterator>::Item> where
    P: FnMut(&<Rev<I> as Iterator>::Item) -> bool
[src]

impl<I> DoubleEndedIterator for Skip<I> where
    I: DoubleEndedIterator + ExactSizeIterator
1.9.0[src]

pub fn next_back(&mut self) -> Option<<Skip<I> as Iterator>::Item>[src]

pub fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <Skip<I> as Iterator>::Item) -> R,
    Skip<I>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Skip<I> as Iterator>::Item) -> Acc, 
[src]

impl<I> DoubleEndedIterator for StepBy<I> where
    I: DoubleEndedIterator + ExactSizeIterator
1.38.0[src]

pub fn next_back(&mut self) -> Option<<StepBy<I> as Iterator>::Item>[src]

pub fn nth_back(&mut self, n: usize) -> Option<<StepBy<I> as Iterator>::Item>[src]

pub fn try_rfold<Acc, F, R>(&mut self, init: Acc, f: F) -> R where
    R: Try<Ok = Acc>,
    F: FnMut(Acc, <StepBy<I> as Iterator>::Item) -> R, 
[src]

pub fn rfold<Acc, F>(self, init: Acc, f: F) -> Acc where
    F: FnMut(Acc, <StepBy<I> as Iterator>::Item) -> Acc,
    StepBy<I>: Sized
[src]

impl<I> DoubleEndedIterator for Take<I> where
    I: DoubleEndedIterator + ExactSizeIterator
1.38.0[src]

pub fn next_back(&mut self) -> Option<<Take<I> as Iterator>::Item>[src]

pub fn nth_back(&mut self, n: usize) -> Option<<Take<I> as Iterator>::Item>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <Take<I> as Iterator>::Item) -> R,
    Take<I>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Take<I> as Iterator>::Item) -> Acc,
    Take<I>: Sized
[src]

impl<I, F> DoubleEndedIterator for Inspect<I, F> where
    F: FnMut(&<I as Iterator>::Item),
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <Inspect<I, F> as Iterator>::Item) -> R,
    Inspect<I, F>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Inspect<I, F> as Iterator>::Item) -> Acc, 
[src]

impl<I, P> DoubleEndedIterator for Filter<I, P> where
    P: FnMut(&<I as Iterator>::Item) -> bool,
    I: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<I as Iterator>::Item>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <Filter<I, P> as Iterator>::Item) -> R,
    Filter<I, P>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Filter<I, P> as Iterator>::Item) -> Acc, 
[src]

impl<I, U> DoubleEndedIterator for Flatten<I> where
    I: DoubleEndedIterator,
    U: DoubleEndedIterator,
    <I as Iterator>::Item: IntoIterator,
    <<I as Iterator>::Item as IntoIterator>::IntoIter == U,
    <<I as Iterator>::Item as IntoIterator>::Item == <U as Iterator>::Item
1.29.0[src]

pub fn next_back(&mut self) -> Option<<U as Iterator>::Item>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <Flatten<I> as Iterator>::Item) -> R,
    Flatten<I>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <Flatten<I> as Iterator>::Item) -> Acc, 
[src]

impl<I, U, F> DoubleEndedIterator for FlatMap<I, U, F> where
    F: FnMut(<I as Iterator>::Item) -> U,
    I: DoubleEndedIterator,
    U: IntoIterator,
    <U as IntoIterator>::IntoIter: DoubleEndedIterator
[src]

pub fn next_back(&mut self) -> Option<<U as IntoIterator>::Item>[src]

pub fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
    R: Try<Ok = Acc>,
    Fold: FnMut(Acc, <FlatMap<I, U, F> as Iterator>::Item) -> R,
    FlatMap<I, U, F>: Sized
[src]

pub fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
    Fold: FnMut(Acc, <FlatMap<I, U, F> as Iterator>::Item) -> Acc, 
[src]

impl<T> DoubleEndedIterator for Empty<T>1.2.0[src]

pub fn next_back(&mut self) -> Option<T>[src]

impl<T> DoubleEndedIterator for Once<T>1.2.0[src]

pub fn next_back(&mut self) -> Option<T>[src]

Loading content...