Crates.io | alo |
lib.rs | alo |
version | 0.3.0 |
source | src |
created_at | 2017-06-05 06:43:16.375014 |
updated_at | 2017-06-10 06:47:18.476543 |
description | ALO means At Least One. It could contain any number of item like `Vec` but it does not heap allocation if it contains only one item. |
homepage | https://github.com/AtsukiTak/alo |
repository | https://github.com/AtsukiTak/alo |
max_upload_size | |
id | 17795 |
size | 6,225 |
ALO means "At Least One". ALO is simple data structure which contains at least one items. ALO does not heap allocation until there is only one item.
// Initialize
let mut alo = ALO::with_item(42);
// Adding
alo.add(777);
alo.add(0);
// Removing
assert_eq!(Some(&42), alo.remove(0));
// Getting
assert_eq!(Some(&777), alo.get(0));