[][src]Module unicycle::pin_slab

A slab-like, pre-allocated storage where the slab is divided into immovable slots. Each allocated slot doubles the capacity of the slab.

Converted from https://github.com/carllerche/slab, this slab however contains a growable collection of fixed-size regions called slots. This allows is to store immovable objects inside the slab, since growing the collection doesn't require the existing slots to move.

Examples

use unicycle::pin_slab::PinSlab;

let mut slab = PinSlab::new();

assert!(!slab.remove(0));
let index = slab.insert(42);
assert!(slab.remove(index));
assert!(!slab.remove(index));

Structs

PinSlab

Pre-allocated storage for a uniform data type, with slots of immovable memory regions.