Struct undo::Merger [−][src]
pub struct Merger<R, C: Command<R> + 'static> { /* fields omitted */ }
A command wrapper which always merges with itself.
This wrapper has an id
of u32::max_value
.
Methods
impl<R, C: Command<R> + 'static> Merger<R, C>
[src]
impl<R, C: Command<R> + 'static> Merger<R, C>
pub fn new(cmd: C) -> Merger<R, C>
[src]
pub fn new(cmd: C) -> Merger<R, C>
Returns a new merger command.
pub fn into_command(self) -> C
[src]
pub fn into_command(self) -> C
Returns the inner command.
Trait Implementations
impl<R, C: Command<R> + 'static> From<C> for Merger<R, C>
[src]
impl<R, C: Command<R> + 'static> From<C> for Merger<R, C>
impl<R, C: Command<R> + 'static> Command<R> for Merger<R, C>
[src]
impl<R, C: Command<R> + 'static> Command<R> for Merger<R, C>
fn apply(&mut self, receiver: &mut R) -> Result<(), Box<Error + Send + Sync>>
[src]
fn apply(&mut self, receiver: &mut R) -> Result<(), Box<Error + Send + Sync>>
Applies the command on the receiver and returns Ok
if everything went fine, and Err
if something went wrong. Read more
fn undo(&mut self, receiver: &mut R) -> Result<(), Box<Error + Send + Sync>>
[src]
fn undo(&mut self, receiver: &mut R) -> Result<(), Box<Error + Send + Sync>>
Restores the state of the receiver as it was before the command was applied and returns Ok
if everything went fine, and Err
if something went wrong. Read more
fn redo(&mut self, receiver: &mut R) -> Result<(), Box<Error + Send + Sync>>
[src]
fn redo(&mut self, receiver: &mut R) -> Result<(), Box<Error + Send + Sync>>
Reapplies the command on the receiver and return Ok
if everything went fine, and Err
if something went wrong. Read more
fn id(&self) -> Option<u32>
[src]
fn id(&self) -> Option<u32>
Used for automatic merging of commands. Read more
impl<R, C: Command<R> + 'static> Debug for Merger<R, C>
[src]
impl<R, C: Command<R> + 'static> Debug for Merger<R, C>