Trait core::iter::adapters::fuse::FuseImpl

source ·
trait FuseImpl<I> {
    type Item;

    // Required methods
    fn next(&mut self) -> Option<Self::Item>;
    fn nth(&mut self, n: usize) -> Option<Self::Item>;
    fn try_fold<Acc, Fold, R>(&mut self, acc: Acc, fold: Fold) -> R
       where Self: Sized,
             Fold: FnMut(Acc, Self::Item) -> R,
             R: Try<Output = Acc>;
    fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
       where P: FnMut(&Self::Item) -> bool;
    fn next_back(&mut self) -> Option<Self::Item>
       where I: DoubleEndedIterator;
    fn nth_back(&mut self, n: usize) -> Option<Self::Item>
       where I: DoubleEndedIterator;
    fn try_rfold<Acc, Fold, R>(&mut self, acc: Acc, fold: Fold) -> R
       where Self: Sized,
             Fold: FnMut(Acc, Self::Item) -> R,
             R: Try<Output = Acc>,
             I: DoubleEndedIterator;
    fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
       where P: FnMut(&Self::Item) -> bool,
             I: DoubleEndedIterator;
}
Expand description

Fuse specialization trait

We only need to worry about &mut self methods, which may exhaust the iterator without consuming it.

Required Associated Types§

Required Methods§

source

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

source

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

source

fn try_fold<Acc, Fold, R>(&mut self, acc: Acc, fold: Fold) -> Rwhere Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>,

source

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: FnMut(&Self::Item) -> bool,

source

fn next_back(&mut self) -> Option<Self::Item>where I: DoubleEndedIterator,

source

fn nth_back(&mut self, n: usize) -> Option<Self::Item>where I: DoubleEndedIterator,

source

fn try_rfold<Acc, Fold, R>(&mut self, acc: Acc, fold: Fold) -> Rwhere Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>, I: DoubleEndedIterator,

source

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: FnMut(&Self::Item) -> bool, I: DoubleEndedIterator,

Implementors§