rust: iterator version of Graph.parents
This is handy for callers that want to simply do:
for p in graph.parents_iter(rev)
although one could argue that actually parents() should return an
array instead of a tuple, giving us a similar iterator for free (but on
references instead of values, unless we also use the arrayvec crate
could help). Notably, the current C-backed parents() internally uses an
array for communication with C code, so that currently, we'd get less memory
copy and less code using an array.
rust: translation of missingancestors
This is as direct as possible a translation of the ancestor.missingancestors
Python class in pure Rust. The goal for this changeset is to make it easy
to compare with the Python version.
We also add to Python tests the cases that helped us develop and debug
this implementation.
Some possible optimizations are marked along the way as TODO comments
rust: translated random test of missingancestors
An alternative would have been to expose to Python
MissingAncestors<VecGraphs> but that would have meant
- pollution of the release build used from Python, whereas we do it in this changeset within the tests submodule
- waiting on rust-cpython bindings to be ready or doing the cumbersome direct-ffi (more pollution with unsafe C code)
I prefer doing bases: impl IntoIterator<Item = Revision> instead of using a where clause.