historic_vec-rs
vec_historic is a Rust collection that extends GapBuffer(a data structure that enables efficient insertions and deletions near a cursor position by keeping a movable empty region (the "gap") inside a contiguous array.) with history tracking, undo support, and element selection.
It's especially useful for implementing editor-like data structures, timelines, or interactive data buffers.
Features
- Efficient insertion and removal (
push_back,push_front,insert, etc.) - History-aware operations with
*_historicversions (e.g.insert_historic,remove_selects_historic) undo()support to revert the last operation- Select and deselect individual elements by index
- Internally backed by a
GapBufferfor fast middle insertions
General usage
use VecHistoric;
use vec_historic;
Using selections
use VecHistoric;
use vec_historic;