pub struct History { /* private fields */ }Expand description
An undo/redo history recorded as inverse operations in a value-backed ledger.
Implementations§
Source§impl History
impl History
Sourcepub fn commit<T: Transport>(
&mut self,
transport: &mut T,
resource: &Symbol,
new_value: Expr,
) -> Result<()>
pub fn commit<T: Transport>( &mut self, transport: &mut T, resource: &Symbol, new_value: Expr, ) -> Result<()>
Commit a new value for resource through transport, recording the
forward and inverse operations. Clears the redo stack.
Sourcepub fn undo<T: Transport>(
&mut self,
transport: &mut T,
) -> Result<Option<Symbol>>
pub fn undo<T: Transport>( &mut self, transport: &mut T, ) -> Result<Option<Symbol>>
Undo the most recent edit by replaying its inverse operation. Returns the
resource that changed, or None if there is nothing to undo.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for History
impl RefUnwindSafe for History
impl Send for History
impl Sync for History
impl Unpin for History
impl UnsafeUnpin for History
impl UnwindSafe for History
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