Crate beton

Crate beton 

Source
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::iter should 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

// tbi

Structs§

IntoIter
An owned iterator over items in the Slab.
IntoValues
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 Slab structure.
Keys
An borrowing iterator over items in the Slab.
Slab
A slab allocator
Values
An borrowing iterator over items in the Slab.
ValuesMut
A mutable iterator over items in the Slab.