pub trait Undoable{
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§
type ProjectType
Required Methods§
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.