`self_referential_elements` module
self_referential_elements
orx_pinned_vec::self_referential_elements
module is created. This method defines all traits required to conveniently, efficiently and simply define inter-element references of a self-referential-collection.
There are three variants for each of next
and prev
references:
- single
- multiple references with dynamic sized (vec)
- multiple references const capacity (
const
array)
Each node can define required traits.
For instance a linked list node would only require the single-next. A doubly-linked-list node would additionally implement single-prev trait.
A tree on the other hand can implement single-prev to define the parent
of a node and a dynamic sized vec to define its children
. This can be replaced by a constant capacity array for a binary search tree, for instance.
Also
iter_mut
is added to the trait definition.