feat(io): read-multi traits#732
Conversation
There was a problem hiding this comment.
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.rsdefining theAsyncReadMultiandAsyncReadMultiAttraits - Wires up the new module in
compio-io/src/read/mod.rswithmod multiandpub use multi::* - Updates the crate-level docs in
compio-io/src/lib.rsto 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.
|
Can you draft some example implentation on |
|
OK, I'll draft one later. |
|
Blocked by #796. |
It's a pity that I'm not able to implement
AsyncReadMultiforCursor<File>, because the stdCursordoesn't provide an API to split the mutable ref to the position and the inner stream.Is it the time to implement a new
Cursortype for our usage?