Skip to content

feat(io_uring): generic access to context and push for Ring and Completion#10071

Merged
kskalski merged 1 commit into
anza-xyz:masterfrom
kskalski:ks/generic_io_uring
Feb 21, 2026
Merged

feat(io_uring): generic access to context and push for Ring and Completion#10071
kskalski merged 1 commit into
anza-xyz:masterfrom
kskalski:ks/generic_io_uring

Conversation

@kskalski
Copy link
Copy Markdown

Problem

Ring and Completion expose similar access functions for context and allowing to push new operations. Sometimes there is client code that should execute the same logic irrespective of operation on Ring or Completion, so there should be a way to generalize access.

Summary of Changes

Introduce trait encapsulating context accessors and push.

Note: moving the functions to trait breaks existing code requiring import of the trait, so I'm open to alternative approaches:

  • make trait functions distinct and just call existing functions on Ring and Completion
  • skip using traits, introduce variant catching &mut Ring or &mut Completion for the rare case of having generic code using either of them

@kskalski kskalski requested a review from alessandrod January 16, 2026 07:24
@kskalski
Copy link
Copy Markdown
Author

Alternative approach using enum is included in #9856

@kskalski kskalski force-pushed the ks/generic_io_uring branch 2 times, most recently from 1fa8180 to 5e983bf Compare February 20, 2026 03:37
@kskalski kskalski marked this pull request as ready for review February 20, 2026 03:41
@kskalski
Copy link
Copy Markdown
Author

kskalski commented Feb 20, 2026

@alessandrod you mentioned the trait approach is preferable. I suppose RingAcccess is a good enough name for that, but I'm open to suggestions.
I rebased and updated the PR, I this this is a fine separate refactoring as is then.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 89.18919% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.0%. Comparing base (e9dfcfd) to head (8edc156).

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #10071     +/-   ##
=========================================
- Coverage    83.0%    83.0%   -0.1%     
=========================================
  Files         849      849             
  Lines      318266   318253     -13     
=========================================
- Hits       264364   264351     -13     
  Misses      53902    53902             
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

vadorovsky
vadorovsky previously approved these changes Feb 20, 2026
Copy link
Copy Markdown
Member

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of that! I was about to nitpick #9856, that I would prefer a trait over a local enum. The name is good enough for me.

Copy link
Copy Markdown
Member

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@kskalski
Copy link
Copy Markdown
Author

Thanks, I will proceed with merging, if we want a different name, we can always update later.

@kskalski kskalski added this pull request to the merge queue Feb 21, 2026
Merged via the queue into anza-xyz:master with commit 67d3dd1 Feb 21, 2026
51 checks passed
@kskalski kskalski deleted the ks/generic_io_uring branch February 21, 2026 09:27
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.

3 participants