Trait redo::Command [] [src]

pub trait Command<R> {
    type Err;
    fn redo(&mut self, receiver: &mut R) -> Result<(), Self::Err>;
fn undo(&mut self, receiver: &mut R) -> Result<(), Self::Err>; fn merge(&mut self, cmd: Self) -> Result<(), Self>
    where
        Self: Sized
, { ... } }

Base functionality for all commands.

Associated Types

The error type.

Required Methods

Executes the desired command and returns Ok if everything went fine, and Err if something went wrong.

Restores the state as it was before redo was called and returns Ok if everything went fine, and Err if something went wrong.

Provided Methods

Used for manual merging of two Commands.

Returns Ok if commands was merged and Err(cmd) if not.

Implementors