๐Ÿ“ฆ atlv24 / vv

A memory-contiguous `Vec<Vec<T>>` with resizable inner vecs.

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/atlv24/vv.git
HTTPS git clone https://github.com/atlv24/vv.git
SSH git clone git@github.com:atlv24/vv.git
CLI gh repo clone atlv24/vv
atlas dostal atlas dostal clippy e7a4788 2 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ Cargo.toml
๐Ÿ“„ LICENSE-APACHE
๐Ÿ“„ LICENSE-MIT
๐Ÿ“„ README.md
๐Ÿ“„ README.md

vv

Vv<T> is a lot like a Vec<Vec<T>> except contiguous in memory. It is unlike other contiguous "jagged array" implementations in that it allows opportunistic growing and shrinking of inner vecs, sometimes requirement moving an entry to achieve the change.

Please consult the documentation for more information.

Add it to your Cargo.toml:

[dependencies]
vv = "0.2"

Example

use vv::Vv;

let mut vv = Vv::<i32>::new();
let first = vv.push([1, 2, 3]);
let second = vv.push([7, 8, 9]);
vv.get_mut(first).rotate_right();
let first = vv.insert(first, 0, 1);

assert_eq!(vv.get(first), [1, 3, 1, 2]);

License

vv is dual-licensed under either:

at your option.

Your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.