shifted_vec 0.1.2

A growable datastructure with positive and negative indexing built on top of `std::vec::Vec` calculating the offset automatically.
Documentation
  • Coverage
  • 92.86%
    13 out of 14 items documented10 out of 14 items with examples
  • Size
  • Source code size: 24.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.35 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • dns2utf8/shifted_vec
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dns2utf8

A growable datastructure with positive and negative indexing built on top of std::vec::Vec calculating the offset automatically.

use shifted_vec::ShiftedVec;

let mut v = ShiftedVec::with_offset_and_capacity(-2, 5);

// populate the ShiftedVec
v.push(0);
v.push(1);
v.push(2);
v.push(3);
v.push(4);

assert_eq!(5, v.len());

assert_eq!(2, v[0]);

// mutable access with index
v[0] = 5;

assert_eq!(5, v[0]);