#arena #generation #no-std

no-std triple_arena

Regular, Chain, Surjection, and Ordered Arenas supporting non-Clone types, deletion, and more

16 releases (breaking)

new 0.13.0 Feb 20, 2024
0.12.1 Aug 29, 2023
0.11.0 Aug 20, 2023
0.9.0 Jun 5, 2023
0.1.0 Jun 2, 2021

#8 in #arenas

Download history 40/week @ 2023-11-07 68/week @ 2023-11-14 53/week @ 2023-11-21 78/week @ 2023-11-28 222/week @ 2023-12-05 293/week @ 2023-12-12 213/week @ 2023-12-19 71/week @ 2023-12-26 55/week @ 2024-01-02 64/week @ 2024-01-09 62/week @ 2024-01-16 56/week @ 2024-01-23 48/week @ 2024-01-30 40/week @ 2024-02-06 124/week @ 2024-02-13 517/week @ 2024-02-20

736 downloads per month
Used in 8 crates (3 directly)

MIT/Apache

365KB
7K SLoC

Triple Arena

Provides 4 very flexible arena types. All support non-Clone entry insertion and deletion. All are indexable with a P: Ptr generic, which contains an optional generation counter to check for invalidity (zero cost when omitted). no_std compatible.

  • Arena<P, T> is the basic unassociated and nonhereditary arena type
  • ChainArena<P, T> allows associating entries together into multiple linear or cyclic chains, representing an idealized doubly linked list stored on an arena
  • SurjectArena<P, K, V> is a special kind of union-find data structure that can associate key entries into nonhereditary sets with a common value entry
  • OrdArena<P, K, V> is a fusion between an ordered balanced tree and an arena. All entries are key and value pairs that are all ordered by the key. Hereditary and nonhereditary insertion is supported. Unlike most BTreeMaps and HashMaps, the P: Ptr references to entries are stable, and can be trivially reused for O(1) operations.

Dependencies

~205KB