pub trait TimeTravel: Iterator + RefClone + SyncTo {
    // Required methods
    fn get(&mut self, index: usize) -> Option<Self::Item>;
    fn is_complete(&self) -> bool;
    fn re_ready(&mut self);
    fn do_ready(&mut self);
    fn save(&self) -> usize;
    fn back(&mut self, index: usize);

    // Provided method
    fn make_range(&self, from: usize) -> Range<usize> { ... }
}
Expand description

Abstraction of a timeline that stores historical records

Required Methods§

source

fn get(&mut self, index: usize) -> Option<Self::Item>

Get the value of the specified position

  • None if the timeline is completed but not found
  • None if index is less than 0
source

fn is_complete(&self) -> bool

Check if the timeline is complete

source

fn re_ready(&mut self)

Check is ready to next again

source

fn do_ready(&mut self)

Re-ready to next

source

fn save(&self) -> usize

Save the current time point

source

fn back(&mut self, index: usize)

Time travel to a point in history

Provided Methods§

source

fn make_range(&self, from: usize) -> Range<usize>

Calculate the range from save point to current

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<I: Iterator> TimeTravel for Span<I>where I::Item: Clone,