pub struct CompoundCommand<C> { /* private fields */ }Expand description
A group of commands executed as a single undo/redo unit.
Commands are applied in order and reversed in reverse order (matching
shruti’s Compound variant behaviour). If a sub-command fails during
apply, all previously-applied sub-commands are rolled back (best-effort).
Implementations§
Trait Implementations§
Source§impl<C: Clone> Clone for CompoundCommand<C>
impl<C: Clone> Clone for CompoundCommand<C>
Source§fn clone(&self) -> CompoundCommand<C>
fn clone(&self) -> CompoundCommand<C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: Command> Command for CompoundCommand<C>
impl<C: Command> Command for CompoundCommand<C>
Source§type Target = <C as Command>::Target
type Target = <C as Command>::Target
The state this command operates on (e.g. a session, timeline, canvas).
Source§type Error = <C as Command>::Error
type Error = <C as Command>::Error
Error type. Use
std::convert::Infallible for infallible commands.Source§fn apply(&mut self, target: &mut Self::Target) -> Result<(), Self::Error>
fn apply(&mut self, target: &mut Self::Target) -> Result<(), Self::Error>
Apply the command to the target. Read more
Source§fn reverse(&mut self, target: &mut Self::Target) -> Result<(), Self::Error>
fn reverse(&mut self, target: &mut Self::Target) -> Result<(), Self::Error>
Reverse the command, restoring the target to its prior state.
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description for undo/redo menu display.
Auto Trait Implementations§
impl<C> Freeze for CompoundCommand<C>
impl<C> RefUnwindSafe for CompoundCommand<C>where
C: RefUnwindSafe,
impl<C> Send for CompoundCommand<C>where
C: Send,
impl<C> Sync for CompoundCommand<C>where
C: Sync,
impl<C> Unpin for CompoundCommand<C>where
C: Unpin,
impl<C> UnsafeUnpin for CompoundCommand<C>
impl<C> UnwindSafe for CompoundCommand<C>where
C: UnwindSafe,
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