Crate triple_arena

source ·
Expand description

Note: there are “std” and “serde_support” feature flags

Modules§

Macros§

  • Convenience macro for quickly making new structs that implement Ptr. The index and generation types can be changed to be smaller for less memory footprint in exchange for smaller maximum arena capacity and generations.

Structs§

  • An arena supporting non-Clone T (T has no requirements other than Sized, but some traits are only active if T implements them), deletion, and optional generation counters.
  • A doubly-linked-list based on an arena for handling usecases involving O(1) insertion, deletion, and other functions on linear lists of elements that we call “chains” of “links”. Multiple separate chains and cyclical chains are supported.
  • This represents a link in a ChainArena that has a public t: T field and Option<Ptr<P>> interlinks to the previous and next links.
  • An Ordered Arena with three parameters: a P: Ptr type that gives single indirection access to elements, a K: Ord key type that is used to define an ordering among elements, and a V value type that is not ordered over but is associated with each K. O(log n) insertions, finds, and deletions are guaranteed.
  • A generalization of an Arena with three parameters: a P: Ptr type, a K key type, and a V value type. Each P points to a single K like in a normal arena, but multiple P can point to a single V in a surjective map structure. When all Ptrs to a single V are removed, the V is removed as well. Efficient union-find functionality is also possible.

Traits§

  • A different kind of iterator that does not borrow the collection.
  • A trait that encapsulates some common functions across the different arena types. Intended for functions that want to be generic over the arenas.
  • A trait containing index and generation information for the Arena type.
  • A trait implemented for structures that have Items that should be Recasted by a Recaster.
  • A trait implemented for structures that can act as a Recaster in Recasting Items.