stable-vec 0.4.1

A Vec-like collection which guarantees stable indices and features O(1) element deletion (semantically similar to `Vec<Option<T>>`). Useful for allocations in graphs or similar data structures.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use stable_vec::StableVec;


fn main() {
    let mut sv = StableVec::from(&['a', 'b', 'c', 'd', 'e', 'f']);
    println!("{:?}", sv);

    sv.remove(1);
    sv.remove(4);
    println!("{:?}", sv);

    sv.push('x');
    println!("{:?}", sv);
}