Expand description
An undo-redo library.
An implementation of the command pattern, where all edits are done by creating objects that applies the modifications. All objects knows how to undo the changes it applies, and by using the provided data structures it is easy to undo and redo edits made to a target.
See the examples for more information.
§Features
Editprovides the base functionality for all edit commands. Multiple edit commands can be merged into a single edit by implementing themergemethod on the edit. This allows smaller edits to be used to build more complex operations, or smaller incremental changes to be merged into larger changes that can be undone and redone in a single step.Recordprovides basic stack based undo-redo functionality.Historyprovides full tree based undo-redo functionality.- Queue and checkpoint functionality is supported for both
RecordandHistory. - The target can be marked as saved to disk and the user will be notified when it changes.
- The amount of changes being tracked can be configured by the user so only the
Nmost recent changes are stored. - Configurable display formatting using the display structures.
§Examples
All examples in the documentation uses the Add
command found here.
§Cargo Feature Flags
| Name | Default | Enables | Description |
|---|---|---|---|
| std | ✓ | alloc | Enables the standard library. |
| alloc | Enables the alloc crate. | ||
| colored | Enables colored output when visualizing the display structures. | ||
| serde | Enables serialization and deserialization. |
Re-exports§
Modules§
Structs§
- At
- A position in a history tree.
- Entry
- Wrapper around an
Editcommand that contains additional metadata.
Enums§
- Event
- Describes an event on the structures.
- Merged
- Says if the
Editcommand have been merged with another command.