#arena #generation #no-std #linked-list

no-std triple_arena

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

16 releases (breaking)

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

#88 in Memory management

Download history 112/week @ 2023-12-04 234/week @ 2023-12-11 133/week @ 2023-12-18 28/week @ 2023-12-25 6/week @ 2024-01-01 26/week @ 2024-01-08 29/week @ 2024-01-22 10/week @ 2024-02-12 135/week @ 2024-02-19 74/week @ 2024-02-26 11/week @ 2024-03-04 47/week @ 2024-03-11 43/week @ 2024-03-18

186 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