[−][src]Trait backtracking_iterator::Walkbackable
An iterator that can be walked back on, parameterised for a lifetime
This trait is a workaround for the lack of generic associated types - it is expected
to be implemented for
every lifetime, for reasons of utility
Associated Types
type RefPoint
The type used to refer to positions in the history
type Item
The type of item in the history
type Walkback: Walkback<'history, Item = Self::Item, RefPoint = Self::RefPoint>
The type of the walk-back iterator
Required methods
fn walk_back(&'history self) -> Self::Walkback
Produce an iterator which goes back over the current history in reverse, and yields items in the history.
extern crate backtracking_iterator; use backtracking_iterator::{BacktrackingIterator, Walkbackable}; let v = vec![1_u8, 2_u8]; let mut rec = backtracking_iterator::BacktrackingRecorder::new(v.into_iter()); let mut bt = rec.copying(); bt.next(); let mut wb = bt.walk_back(); assert!(wb.next().unwrap() == 1_u8);
Implementors
impl<'history, 'record, I: 'history> Walkbackable<'history> for CopyingBacktrackingIterator<'record, I> where
I: Iterator,
I::Item: Clone,
'history: 'record,
[src]
I: Iterator,
I::Item: Clone,
'history: 'record,
type RefPoint = usize
type Item = I::Item
type Walkback = CopyingWalkback<'history, I>
ⓘImportant traits for CopyingWalkback<'history, I>fn walk_back(&'history self) -> CopyingWalkback<'history, I>
[src]
ⓘImportant traits for CopyingWalkback<'history, I>
impl<'history, 'record, Iter: 'history> Walkbackable<'history> for ReferencingBacktrackingIterator<'record, Iter> where
Iter: Iterator,
'history: 'record,
[src]
Iter: Iterator,
'history: 'record,
type RefPoint = usize
type Item = &'record Iter::Item
type Walkback = ReferencingWalkback<'record, Iter>
ⓘImportant traits for ReferencingWalkback<'record, Iter>fn walk_back(&'history self) -> ReferencingWalkback<'record, Iter>
[src]
ⓘImportant traits for ReferencingWalkback<'record, Iter>