pub struct GraphHistory { /* private fields */ }Expand description
A simple undo/redo history for committed graph transactions.
Implementations§
Source§impl GraphHistory
impl GraphHistory
pub fn new(limit: usize) -> Self
pub fn clear(&mut self)
pub fn can_undo(&self) -> bool
pub fn can_redo(&self) -> bool
pub fn undo_len(&self) -> usize
pub fn redo_len(&self) -> usize
Sourcepub fn record(&mut self, tx: GraphTransaction)
pub fn record(&mut self, tx: GraphTransaction)
Records a committed transaction (original + derived concretization ops).
Sourcepub fn undo<E>(
&mut self,
apply: impl FnMut(&GraphTransaction) -> Result<GraphTransaction, E>,
) -> Result<bool, E>
pub fn undo<E>( &mut self, apply: impl FnMut(&GraphTransaction) -> Result<GraphTransaction, E>, ) -> Result<bool, E>
Undoes the last recorded transaction by applying its inverse transaction.
The apply closure is responsible for applying the transaction to the graph and returning
the committed transaction (including any derived ops produced by the profile pipeline).
Sourcepub fn redo<E>(
&mut self,
apply: impl FnMut(&GraphTransaction) -> Result<GraphTransaction, E>,
) -> Result<bool, E>
pub fn redo<E>( &mut self, apply: impl FnMut(&GraphTransaction) -> Result<GraphTransaction, E>, ) -> Result<bool, E>
Redoes the last undone transaction.
Trait Implementations§
Source§impl Clone for GraphHistory
impl Clone for GraphHistory
Source§fn clone(&self) -> GraphHistory
fn clone(&self) -> GraphHistory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphHistory
impl Debug for GraphHistory
Auto Trait Implementations§
impl Freeze for GraphHistory
impl RefUnwindSafe for GraphHistory
impl Send for GraphHistory
impl Sync for GraphHistory
impl Unpin for GraphHistory
impl UnsafeUnpin for GraphHistory
impl UnwindSafe for GraphHistory
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