Repository navigation
Copy, Send and Sync for NodePtr and NodeIdx
Changes
Implements Copy for NodePtr.
Implements Send and Sync for NodeIdx.
Carries out a major refactoring for pointers and indices passed as values rather than references.
Breaking Changes
This version introduces breaking changes due to the Copy implementation of the node pointer and node index. As recommended, their methods now take self rather than &self. Further, SelfRefCol that takes a node pointer or index as an argument now accept values by copy semantics rather than as references as in the prior version. Although this makes it more convenient to work with indices, it leads to compilation errors in the old code.
For instance, the following code block will not compile in the new version:
let col: SelfRefCol<_, _, _> = ...;
let idx: NodeIdx<_> = ...;
let node = col.node_from_idx(&idx); // errorIt needs to be fixed as below:
let node = col.node_from_idx(idx);Thanks to @hasezoey for suggestions and reviews.