Trait parser_fuck::common::TimeTravel
source · 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§
sourcefn get(&mut self, index: usize) -> Option<Self::Item>
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
sourcefn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Check if the timeline is complete
Provided Methods§
sourcefn make_range(&self, from: usize) -> Range<usize>
fn make_range(&self, from: usize) -> Range<usize>
Calculate the range from save point to current
Object Safety§
This trait is not object safe.