jamsocket / aper

Synchronizable structs for Rust.

Home Page:https://aper.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tree data structure

paulgb opened this issue · comments

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

  • Elements in a vector graphic that supports nested grouping (e.g. SVG, geojson)
  • Comments in a threaded comment format

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.