[][src]Module gen_vec::exposed

Uses exposed/independent index allocator

Examples

use gen_vec::Index;
use gen_vec::exposed::{IndexAllocator, ExposedGenVec};

let mut allocator: IndexAllocator = IndexAllocator::new();

let index: Index = allocator.allocate();

let mut vec: ExposedGenVec<i32> = ExposedGenVec::new();
vec.set(index, 5);
assert!(vec.contains(index));

let value: Option<&i32> = vec.get(index);
assert_eq!(value, Some(&5));

Structs

ExposedGenVec

Generationally indexed vector that relies on an independent IndexAllocator

IndexAllocator

Allocates and deallocates indices for a ExposedGenVec

IntoIter

Struct for consuming a ExposedGenVec into an iterator

Iter

Struct for creating an iterator over an immutable ExposedGenVec reference

IterMut

Struct for creating an iterator over a mutable ExposedGenVec reference