#framework #reference #relationship #utility #library #directed-acyclic-graph #storage

persian-rug

Framework for bringing together disparate objects with inconvenient relationships

5 releases

0.1.4 Jun 7, 2024
0.1.3 Jun 6, 2024
0.1.2 Jun 17, 2022
0.1.1 May 17, 2022
0.1.0 May 15, 2022

#423 in Data structures

Download history 22/week @ 2024-06-20 6/week @ 2024-06-27 7/week @ 2024-07-04 12/week @ 2024-07-11 10/week @ 2024-07-18 30/week @ 2024-07-25 15/week @ 2024-08-01 4/week @ 2024-08-08 1/week @ 2024-08-15 4/week @ 2024-08-22 22/week @ 2024-08-29 5/week @ 2024-09-05 20/week @ 2024-09-12 25/week @ 2024-09-19 17/week @ 2024-09-26 3/week @ 2024-10-03

68 downloads per month
Used in 5 crates

MIT/Apache

40KB
613 lines

persian-rug - it really ties the room together

This is a framework for building and mutating collections of objects that refer to one another. It supports having multiple different types participating in the graph. It does not require that links form a directed acyclic graph, or tree, or anything convenient.

To do this, all objects are stored in a centralised holder (a Context), which passes out Proxy objects to serve as pointers. All access requires the context to be present, and this has some limitations with Rust's current mutable reference rules (it's not possible to borrow the same context mutably more than once, even when accessing different pieces of data within it).

Deletion of objects is not supported at present. Contexts many only grow to encompass more objects, old objects may not be retired. This restriction might be lifted a future version of this crate.

License

This crate is made available under either an Apache-2.0 or an MIT license.

Dependencies

~1.5MB
~38K SLoC