Skip to content

feat(io): read-multi traits#732

Merged
Berrysoft merged 5 commits into
compio-rs:masterfrom
Berrysoft:multi-traits
Apr 2, 2026
Merged

feat(io): read-multi traits#732
Berrysoft merged 5 commits into
compio-rs:masterfrom
Berrysoft:multi-traits

Conversation

@Berrysoft
Copy link
Copy Markdown
Member

It's a pity that I'm not able to implement AsyncReadMulti for Cursor<File>, because the std Cursor doesn't provide an API to split the mutable ref to the position and the inner stream.

Is it the time to implement a new Cursor type for our usage?

@Berrysoft Berrysoft added enhancement New feature or request package: io Related to compio-io labels Mar 4, 2026
@Berrysoft Berrysoft requested review from George-Miao and Copilot March 4, 2026 17:00
@Berrysoft Berrysoft self-assigned this Mar 4, 2026
@Berrysoft Berrysoft mentioned this pull request Mar 4, 2026
10 tasks
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces two new public traits, AsyncReadMulti and AsyncReadMultiAt, to the compio-io crate. These traits extend the existing AsyncReadManaged and AsyncReadManagedAt traits respectively, adding support for continuous, stream-based reads using a buffer pool — yielding a Stream of managed buffers instead of a single buffer per call.

Changes:

  • Adds compio-io/src/read/multi.rs defining the AsyncReadMulti and AsyncReadMultiAt traits
  • Wires up the new module in compio-io/src/read/mod.rs with mod multi and pub use multi::*
  • Updates the crate-level docs in compio-io/src/lib.rs to list the new traits under "Managed IO"

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
compio-io/src/read/multi.rs New file defining AsyncReadMulti and AsyncReadMultiAt traits with read_multi and read_multi_at methods returning impl Stream
compio-io/src/read/mod.rs Adds mod multi submodule and re-exports its contents
compio-io/src/lib.rs Adds crate-level documentation entries for the two new traits under the "Managed IO" section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread compio-io/src/read/multi.rs Outdated
Comment thread compio-io/src/read/multi.rs Outdated
Comment thread compio-io/src/read/multi.rs Outdated
Comment thread compio-io/src/read/multi.rs
Comment thread compio-io/src/read/multi.rs Outdated
Comment thread compio-io/src/read/multi.rs Outdated
@George-Miao
Copy link
Copy Markdown
Member

Can you draft some example implentation on compio-fs or compio-net in another PR? Just want to grasp what the underlying stream looks like and decide wether this design fits.

@Berrysoft
Copy link
Copy Markdown
Member Author

OK, I'll draft one later.

@Berrysoft Berrysoft added this to the v0.19 milestone Mar 11, 2026
@George-Miao
Copy link
Copy Markdown
Member

Blocked by #796.

@George-Miao George-Miao marked this pull request as draft March 26, 2026 16:49
@Berrysoft Berrysoft marked this pull request as ready for review April 2, 2026 09:22
@Berrysoft Berrysoft requested a review from George-Miao April 2, 2026 09:22
Comment thread compio-io/src/read/multi.rs
@Berrysoft Berrysoft requested a review from George-Miao April 2, 2026 17:16
@Berrysoft Berrysoft enabled auto-merge April 2, 2026 17:22
Copy link
Copy Markdown
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

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

LGTM

@Berrysoft Berrysoft added this pull request to the merge queue Apr 2, 2026
Merged via the queue into compio-rs:master with commit e315ae1 Apr 2, 2026
66 checks passed
@Berrysoft Berrysoft deleted the multi-traits branch April 2, 2026 17:24
@github-actions github-actions Bot mentioned this pull request Apr 2, 2026
This was referenced Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request package: io Related to compio-io

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants