Extend and revisit iteration implementation - #235
Open
CramBL wants to merge 4 commits into
Open
Conversation
Both enums were private to hl::group, so iter_visit could only be called with Default::default() for the order arguments. The previously private TraversalOrder is renamed to IndexType with variants Name and CreationOrder, matching H5_index_t.
CramBL
force-pushed
the
export-iteration-order
branch
2 times, most recently
from
September 7, 2026 18:09
599dc14 to
ace806d
Compare
This was referenced Sep 7, 2026
index_type now comes before iteration_order, as in H5Literate2. Until IndexType and IterationOrder were exported the order arguments could only be passed as Default::default(), so the reorder breaks no caller. The closure takes the link name and LinkInfo and returns Result<()>. Its error is returned from iter_visit instead of being reported as a stop with a partial result. The group argument is dropped since H5Literate always passes back the group being iterated, and the accumulator argument is dropped since the closure can capture its own state. find_link takes a closure returning Result<Option<B>> and stops at the first Some, returning the value. Together with the error this maps onto the continue, stop and fail returns of the C callback. iter_visit_from takes a LinkCursor and returns the cursor of the next link together with the value, so a stopped iteration can be resumed. The cursor carries the index type and iteration order it counts along, so it cannot be reused with a different traversal. A cursor at or past the last link yields None instead of the HDF5 out of bounds error. A panic in the closure is resumed after H5Literate returns instead of being reported as an HDF5 error.
CramBL
force-pushed
the
export-iteration-order
branch
from
September 7, 2026 19:41
ace806d to
1265e92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #228
Resolves #230
It's quite a mouthful, I realize that, but there were some problems with the existing implementation, mostly just several limitations and assumptions, please see commit messages for more information. I recommend reviewing the commits in order.