pub enum Select {
Initial,
At(usize),
Current,
}Expand description
Select a snapshot in a snaplog.
If a snaplog has not yet be mutated then Select::Current == Select::Initial == Select::At(0).
§Examples
let mut snaplog = Snaplog::try_from_history((0..=10).map(|n| n * 2))?;
assert_eq!(snaplog[Select::Initial], 0);
assert_eq!(snaplog[Select::At(0)], 0);
assert_eq!(snaplog[Select::At(1)], 2);
assert_eq!(snaplog[Select::At(9)], 18);
assert_eq!(snaplog[Select::At(10)], 20);
assert_eq!(snaplog[Select::Current], 20);Variants§
Initial
Select the initial snapshot before all changes.
At(usize)
Select the snapshot after n changes.
Current
Select the current snapshot after all changes.
Trait Implementations§
impl Copy for Select
Auto Trait Implementations§
impl Freeze for Select
impl RefUnwindSafe for Select
impl Send for Select
impl Sync for Select
impl Unpin for Select
impl UnwindSafe for Select
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more