Now that VertexRefs can easily be stored in an external data structure,
de-duplication via transposition tables or a hashmap may be handled outside of
the `Graph` struct proper.
Generative branding as done in the view module was dogged by the limited
lifetime of a View: you could not hang onto references into a View beyond the
scope of the lifetime brand. This lifetime brand made it difficult to write
generic data structures that used view::NodeRef and view::EdgeRef.
This rewrite makes a Graph and these handle types optionally parameterized by a
lifetime brand. This allows us to simplify things substantially and drop a lot
of code that is no longer necessary.
* src/base.rs: eliminated in favor of putting all types into src/lib.rs.
* src/lib.rs: rewrite Graph to provide operations in terms of EdgeRef and
VertexRef handle types. Use generative branding to make this zero-cost when
the user wants it to be.
* src/mark_compact.rs: use new API.
* src/mutators.rs: no longer necessary now that mutation through zero-cost
handles is available.
* src/nav.rs: no longer necessary now that navigation through zero-cost handles
is available.
* src/search.rs: no longer necessary because it is trivial to store EdgeRefs and
VertexRefs while doing graph traversal.
* src/view.rs: functionality folded into the main Graph struct in src/lib.rs.
Now it is in-place and should take less space for at least some workloads. See
TODOs left behind for thoughts on future directions it may make sense to go in
for performance tuning.
This still needs better test coverage, but these code improvements should make
it clear that there are no obvious fundamental flaws to this approach.