A contiguous growable array type with heap-allocated contents with fast deletion process.
This is a wrapper for Vec<Option<T>>
- You want fast random access and deletion, but don't want to use expensive structures like HashMap.
- You want to guarantee that the same index keeps the same value even if another element is removed.
Cargo.toml
[dependencies]
opt_vec = "*"
and then
use opt_vec::OptVec;
let mut v = OptVec::new();
v.push(1);
Cargo.toml
[dependencies.opt_vec]
version = "*"
default-features = false
features = ["alloc"]