jamsocket / aper

A Rust data structure library built on state machines.
https://aper.dev
MIT License
299 stars 12 forks source link

Tree data structure #5

Open paulgb opened 3 years ago

paulgb commented 3 years ago

Aper should have a Tree data structure that would represent nestable data structures, such as:

It should be possible to move elements from one section of the tree to another. In order to handle this nicely, it probably makes sense to have one "pool" for the Tree, mapping uuids to interior state machines, and then have a nested structure of TreeNodes that refer to those uuids. This means that we need to make sure loops are broken and (equivalently) that every node has a parent in the tree.