pub trait Record {
    type RefPoint;

    fn get_ref_point(&self) -> Self::RefPoint;
    fn forget_before(&mut self, point: Self::RefPoint);

    fn forget(&mut self) { ... }
}
Expand description

A historical record representation

Required Associated Types

The type used to refer to positions in the history

Required Methods

Yield a reference to the current point in the history This reference must be valid for as long as the current point remains in the history

Eliminate all the values before the given reference point from the history

Provided Methods

Forget all the values before the current position in the iterator

extern crate backtracking_iterator;
use backtracking_iterator::{Record, BacktrackingIterator};

let v = vec![1_u8, 2_u8];
let mut rec = backtracking_iterator::BacktrackingRecorder::new(v.into_iter());
{
  let mut bt = rec.copying();
  bt.next();
}

//Before we call this, 1_u8 is in the history
rec.forget();

{
  let mut bt = rec.copying();
  assert!(bt.next().unwrap() == 2_u8);
}

Implementors