Trait redo::Command [−][src]
pub trait Command: Sized {
type Target;
type Error;
fn apply(&mut self, target: &mut Self::Target) -> Result<Self>;
fn undo(&mut self, target: &mut Self::Target) -> Result<Self>;
fn redo(&mut self, target: &mut Self::Target) -> Result<Self> { ... }
fn merge(&mut self, command: Self) -> Merge<Self> { ... }
}
Expand description
Base functionality for all commands.
Associated Types
Required methods
Applies the command on the target and returns Ok
if everything went fine,
and Err
if something went wrong.
Provided methods
Reapplies the command on the target and return Ok
if everything went fine,
and Err
if something went wrong.
The default implementation uses the apply
implementation.