Trait Undoable

Source
pub trait Undoable
where Self: Clone + PartialEq,
{ type ProjectType; // Required method fn restore(self, target: &mut Self::ProjectType) -> Self; }
Expand description

When calling undo() or redo(), the restore() function is always called and applies this value TO the project and returns a value with the previous state FROM the project. The “Undoable” type, usually an enum with many variants, needs to know how to restore itself, and may need to contain all information required to place it correctly into the project.

Required Associated Types§

Required Methods§

Source

fn restore(self, target: &mut Self::ProjectType) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§