pub struct Journal<S> { /* private fields */ }Expand description
A journal that records operations as they are applied, enabling undo.
Implementations§
Source§impl<S> Journal<S>
impl<S> Journal<S>
Sourcepub fn apply(&mut self, op: Box<dyn Reversible<S>>, state: &mut S)
pub fn apply(&mut self, op: Box<dyn Reversible<S>>, state: &mut S)
Apply an operation and record it.
Sourcepub fn undo_count(&self) -> usize
pub fn undo_count(&self) -> usize
Number of operations that can be undone.
Sourcepub fn redo_count(&self) -> usize
pub fn redo_count(&self) -> usize
Number of operations that can be redone.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Journal<S>
impl<S> !RefUnwindSafe for Journal<S>
impl<S> !Send for Journal<S>
impl<S> !Sync for Journal<S>
impl<S> Unpin for Journal<S>
impl<S> UnsafeUnpin for Journal<S>
impl<S> !UnwindSafe for Journal<S>
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