Skip to content

Releases: orxfun/orx-pinned-vec

`contains_reference` & `set_len`

10 Mar 18:43
5154cd1
Compare
Choose a tag to compare
  • PinnedVec::contains_reference method is added to the trait definition. This method is expected to return true whenever index_of returns Some. However, since the contains_reference requires less work and can return faster, a default implementation is not provided.
  • Helper method slice::contains_reference is implemented and made available to be used by the trait implementers.
  • set_len method is required.

Also

  • rand and rand_chacha dependencies are removed. These had been used only for creating random indices for the RefMap struct, which is then used by test_pinned_vec method. An std::time random index generator is used instead, which is good enough for this scenario.

major refactoring applied

27 Feb 21:18
67d9c83
Compare
Choose a tag to compare

The following major revision is applied to the pinned vector:

  • pinned elements guarantee is formalized and documented,
  • unsafe methods such as clone or insert 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

06 Jan 20:00
9ba3256
Compare
Choose a tag to compare
Merge pull request #9 from orxfun/documentation

documentation revised wrt LinkedList impl

`self_referential_elements` module

02 Jan 21:37
fdea967
Compare
Choose a tag to compare

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.