Expand description
A tree-backed slab allocator
§Differences with the slab crate
Entries into the slab crate’s slab structure are backed by a linked lists,
which makes it expensive to iterate over. According to slab’s
iterator docs:
Slab::itershould generally be avoided as it is not efficient. Iterators must iterate over every slot in the slab even if it is vacant. As such, a slab with a capacity of 1 million but only one stored value must still iterate the million slots.
This crate uses a tree to hold the indexes instead, ensuring that iterating over the entries in the slab remains cheap.
§Examples
// tbiStructs§
- Into
Iter - An owned iterator over items in the
Slab. - Into
Values - An owned iterator over items in the
Slab. - Iter
- An borrowing iterator over items in the
Slab. - IterMut
- A mutable iterator over items in the
Slab. - Key
- An key into the
Slabstructure. - Keys
- An borrowing iterator over items in the
Slab. - Slab
- A slab allocator
- Values
- An borrowing iterator over items in the
Slab. - Values
Mut - A mutable iterator over items in the
Slab.