Crate one_stack_vec [] [src]

OneStackVec is simple data structure which contains any number of items. If there is one or zero item, ALO does not heap allocate. If there is more than one items, ALO does heap allocate.

Examples

use one_stack_vec::OneStackVec;

let mut items = OneStackVec::new();

// Adding
items.push(42);

// Getting
assert_eq!(Some(&42), items.get(0));

// Removing
assert_eq!(Some(42), items.pop());
assert_eq!(None, items.pop());

Macros

one_stack_vec

Structs

Iter
OneStackVec