Crates.io | charcoal |
lib.rs | charcoal |
version | 1.1.0 |
source | src |
created_at | 2020-09-23 08:57:31.157334 |
updated_at | 2021-03-13 22:45:22.178405 |
description | Implements tree data structures and interfaces to work with them. |
homepage | |
repository | https://github.com/kotauskas/charcoal.rs |
max_upload_size | |
id | 292011 |
size | 308,422 |
Implements arena-allocated tree data structures and interfaces to work with them.
Charcoal implements various kinds of trees using a technique called "arena-allocated trees", described by Ben Lovy. The gist of it is that the trees use some sort of backing storage to store the elements, typically a Vec
(or its variants, like SmallVec
or ArrayVec
), and instead of using pointers to link to children, indices into the storage are used instead. This significantly improves element insertion and removal performance as compared to Rc
-based trees, and gives room for supporting configurations without a global memory allocator.
Charcoal uses Granite to handle arena-allocated storage. Several feature flags are used to enable various dependencies on various storage types via forwaring them to Granite.
std
(enabled by default) — enables the full standard library, disabling no_std
for the crate. Currently, this only adds Error
trait implementations for some types.unwind_safety
(enabled by default) — Must be enabled when using the unwinding panic implementation, otherwise using methods which accept closures is undefined behavior. Requires std
. Not a concern in no_std
builds, since those do not have a panicking runtime by default.alloc
(enabled by default) — adds ListStorage
trait implementations for standard library containers, except for LinkedList
, which is temporarily unsupported. This does not require standard library support and will only panic at runtime in no_std
environments without an allocator.smallvec
— forwarded to Granite, adds a ListStorage
trait implementation for SmallVec
.slab
— forwarded to Granite, adds a Storage
trait implementation for Slab
.slotmap
— forwarded to Granite, adds Storage
trait implementations for SlotMap
, HopSlotMap
and DenseSlotMap
.union_optimizations
— forwarded to Granite, adds some layout optimizations by using untagged unions, decreasing memory usage in SparseStorage
. Requires a nightly compiler (see tracking issue for RFC 2514) and thus is disabled by default.arrayvec
(required) — ^0.5
granite
(required) — ^1.0
smallvec
(optional) — ^1.4
slab
(optional) — ^0.4
slotmap
(optional) — ^0.4
You can help by contributing to Charcoal in those aspects: