Skip to content
/ opt_vec Public

A contiguous growable array type with heap-allocated contents with fast deletion process.

License

Notifications You must be signed in to change notification settings

whtsht/opt_vec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opt_vec

Crate

A contiguous growable array type with heap-allocated contents with fast deletion process.

This is a wrapper for Vec<Option<T>>

Use an OptVec when:

  • 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.

Getting Started

Cargo.toml

[dependencies]
opt_vec = "*"

and then

use opt_vec::OptVec;

let mut v = OptVec::new();
v.push(1);

Support no_std

Cargo.toml

[dependencies.opt_vec]
version = "*"
default-features = false
features = ["alloc"]

About

A contiguous growable array type with heap-allocated contents with fast deletion process.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages