Skip to content

Callback-based for_each_payload_block - #8766

Merged
xzfc merged 1 commit into
devfrom
uio-for_each_payload_block
Apr 27, 2026
Merged

xzfc merged 1 commit into
devfrom
uio-for_each_payload_block

Conversation

@xzfc

@xzfc xzfc commented Apr 22, 2026

Copy link
Copy Markdown
Member

Continuation of #8764.

In this PR, payload_blocks(…) -> Iterator<…> is replaced with for_each_payload_block(…, f: &mut dyn FnMut).

Why: same goal as in #8764. Now iter_values is removed in favor of for_each_value. So, porting MmapHashMap::keys should be easier.

@xzfc
xzfc force-pushed the uio-FacetIndex-callbacks branch from c90ee2d to dc381f3 Compare April 22, 2026 09:57
@xzfc
xzfc force-pushed the uio-for_each_payload_block branch from c659062 to 790924c Compare April 22, 2026 09:57
@xzfc
xzfc force-pushed the uio-FacetIndex-callbacks branch from 5526986 to b509cb1 Compare April 24, 2026 13:35
@xzfc
xzfc force-pushed the uio-for_each_payload_block branch from 790924c to b806e1e Compare April 24, 2026 13:35
Base automatically changed from uio-FacetIndex-callbacks to dev April 24, 2026 14:06
@xzfc
xzfc force-pushed the uio-for_each_payload_block branch from b806e1e to a0027ec Compare April 24, 2026 14:10
@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This pull request converts the payload-block enumeration API across the field index layer from an iterator-based pattern to a callback-driven visitor pattern. The trait method PayloadFieldIndex::payload_blocks() (returning Box<dyn Iterator<Item = OperationResult<PayloadBlockCondition>>>) is replaced with PayloadFieldIndex::for_each_payload_block() (accepting a mutable callback FnMut(PayloadBlockCondition) -> OperationResult<()> and returning OperationResult<()>). This change propagates through trait definitions (PayloadFieldIndex, PayloadIndex, InvertedIndex) and all their implementations across bool, map, numeric, geo, null, and text indices. Additionally, iter_values() methods are removed from map index types. Tests and call sites are updated accordingly to use the new callback API.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested reviewers

  • generall
  • coszio
  • ffuugoo
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing an iterator-based API with a callback-based API for payload block traversal.
Description check ✅ Passed The description clearly relates to the changeset by explaining the motivation for replacing the iterator-based payload_blocks API with a callback-based for_each_payload_block approach.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch uio-for_each_payload_block

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@xzfc
xzfc merged commit bc958ce into dev Apr 27, 2026
24 of 27 checks passed
@xzfc
xzfc deleted the uio-for_each_payload_block branch April 27, 2026 11:07
timvisee pushed a commit that referenced this pull request May 8, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jul 31, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants