Expand description
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]);Structsยง
- Shifted
Iterator - See
iter_shifted() - Shifted
Iterator Mut - See
iter_shifted_mut() - Shifted
Vec - Wrapping the
std::vec::Vecthat keeps track of the offset that can handle any Type