Struct undo::record::Checkpoint [−][src]
Wraps a record and gives it checkpoint functionality.
Implementations
impl<A: Action, F: FnMut(Signal)> Checkpoint<'_, A, F>
[src]
pub fn apply(&mut self, target: &mut A::Target, action: A) -> Result<A>
[src]
Calls the apply
method.
pub fn undo(&mut self, target: &mut A::Target) -> Result<A>
[src]
Calls the undo
method.
pub fn redo(&mut self, target: &mut A::Target) -> Result<A>
[src]
Calls the redo
method.
pub fn commit(self)
[src]
Commits the changes and consumes the checkpoint.
pub fn cancel(self, target: &mut A::Target) -> Result<A>
[src]
Cancels the changes and consumes the checkpoint.
Errors
If an error occur when canceling the changes, the error is returned and the remaining actions are not canceled.
pub fn queue(&mut self) -> Queue<'_, A, F>
[src]
Returns a queue.
pub fn checkpoint(&mut self) -> Checkpoint<'_, A, F>
[src]
Returns a checkpoint.
Trait Implementations
impl<'a, A: Debug, F: Debug> Debug for Checkpoint<'a, A, F>
[src]
impl<'a, A, F> From<&'a mut Record<A, F>> for Checkpoint<'a, A, F>
[src]
Auto Trait Implementations
impl<'a, A, F> RefUnwindSafe for Checkpoint<'a, A, F> where
A: RefUnwindSafe,
F: RefUnwindSafe,
A: RefUnwindSafe,
F: RefUnwindSafe,
impl<'a, A, F> Send for Checkpoint<'a, A, F> where
A: Send,
F: Send,
A: Send,
F: Send,
impl<'a, A, F> Sync for Checkpoint<'a, A, F> where
A: Sync,
F: Sync,
A: Sync,
F: Sync,
impl<'a, A, F> Unpin for Checkpoint<'a, A, F> where
A: Unpin,
A: Unpin,
impl<'a, A, F> !UnwindSafe for Checkpoint<'a, A, F>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,