Releases: orxfun/orx-pinned-vec
Releases · orxfun/orx-pinned-vec
major refactoring applied
The following major revision is applied to the pinned vector:
- pinned elements guarantee is formalized and documented,
- unsafe methods such as
clone
orinsert
are now safe. pinned vector on its own cannot build inter-element references; hence, these methods are not unsafe. this responsibility is passed to the struct enabling these references, namely, orx_selfref_col. - in addition to being a marker trait, this crate now provides
test_pinned_vec
function which is essential in asserting that a pinned vector implementation satisfies the required guarantees.
Documentation revised wrt LinkedList:1.0 impl
Merge pull request #9 from orxfun/documentation documentation revised wrt LinkedList impl
`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.