slotmapvec 0.1.3

Deprecated: use slotmap
Documentation
  • Coverage
  • 100%
    17 out of 17 items documented5 out of 17 items with examples
  • Size
  • Source code size: 16 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.81 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • luteberget/slotmapvec-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • luteberget

Deprecated: use slotmap.

Slot map: array storage with persistent indices

Vec<T>-like collection with stable indices. The underlying array's indices are re-used by incrementing a versioning tag in the index type.

The SlotMapIndex type consists of a u32 for storing the index into the underlying array, and a u32 for storing the version. Deleting and inserting more times than the maximum value of u32 will cause overflow and index conflict bugs.

Example

# use slotmapvec::*;
let mut map = SlotMapVec::new();

map.insert(123213);
let idx = map.insert(34234);
map.insert(654654);

map.remove(idx);
let idx2 = map.insert(999);
assert_eq!(map.get(idx), None);
assert_eq!(map.get(idx2), Some(&999));