unsafe trait StepByBackImpl<I> {
    type Item;

    // Required methods
    fn spec_next_back(&mut self) -> Option<Self::Item>
       where I: DoubleEndedIterator + ExactSizeIterator;
    fn spec_nth_back(&mut self, n: usize) -> Option<Self::Item>
       where I: DoubleEndedIterator + ExactSizeIterator;
    fn spec_try_rfold<Acc, F, R>(&mut self, init: Acc, f: F) -> R
       where I: DoubleEndedIterator + ExactSizeIterator,
             F: FnMut(Acc, Self::Item) -> R,
             R: Try<Output = Acc>;
    fn spec_rfold<Acc, F>(self, init: Acc, f: F) -> Acc
       where I: DoubleEndedIterator + ExactSizeIterator,
             F: FnMut(Acc, Self::Item) -> Acc;
}
Expand description

Specialization trait for double-ended iteration.

See also: StepByImpl

Safety

The specializations must be implemented together with StepByImpl where applicable. I.e. if StepBy does support backwards iteration for a given iterator and that is specialized for forward iteration then it must also be specialized for backwards iteration.

Required Associated Types§

Required Methods§

source

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

source

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

source

fn spec_try_rfold<Acc, F, R>(&mut self, init: Acc, f: F) -> Rwhere I: DoubleEndedIterator + ExactSizeIterator, F: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>,

source

fn spec_rfold<Acc, F>(self, init: Acc, f: F) -> Accwhere I: DoubleEndedIterator + ExactSizeIterator, F: FnMut(Acc, Self::Item) -> Acc,

Implementors§