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§
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) -> Rwhere
I: DoubleEndedIterator + ExactSizeIterator,
F: FnMut(Acc, Self::Item) -> R,
R: Try<Output = Acc>,
fn spec_rfold<Acc, F>(self, init: Acc, f: F) -> Acc
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.