#stable #vec #generic #general

general_stable_vec

A Vec implementation with stable indices

23 releases (14 breaking)

Uses new Rust 2024

new 0.15.0 Apr 13, 2025
0.13.0 Apr 12, 2025
0.12.1 Oct 19, 2024
0.11.1 Apr 21, 2024
0.4.0 Mar 28, 2024

#632 in Data structures

Download history 4/week @ 2025-02-02 3/week @ 2025-02-09 174/week @ 2025-04-06

185 downloads per month

BSD-2-Clause

25KB
455 lines

A general stable vector implementation.

A stable vector is a vector for which each inserted element keeps its index until it is removed.


General Stable Vec

A stable vector implementation that allows insertions and deletions in amortised O(1), and uses memory linear in the maximum number of elements that the vector contained.

A stable vector is a vector that keeps its indices stable, i.e. the index of an element is assigned upon insertion and not changed until removal. This works much like a hash map, except that in this implementation, the index is assigned by the stable vector, and cannot be chosen by the user.

Dependencies

~215–710KB
~16K SLoC