feat: implement AsReadFd and AsWriteFd for File - #382
Open
raema wants to merge 2 commits into
Open
Conversation
raema
force-pushed
the
fix-file-asreadfd
branch
from
January 29, 2026 07:44
47f4775 to
7f187f8
Compare
raema
force-pushed
the
fix-file-asreadfd
branch
from
January 29, 2026 07:52
7f187f8 to
b26fd0d
Compare
|
could we please get this merged? it really is a missing feature right now. @raema do you plan on fixing the failing pipeline? |
Collaborator
|
@raema hello, there are some CI errors, could you help please fix them? Thanks a lot. |
Collaborator
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.
Problem
monoio::fs::Filecan't be used with splice traits (SpliceSource,SpliceSink) because itdoesn't implement
AsReadFdorAsWriteFd.Approach
Implement
AsReadFdandAsWriteFdforFile, matching the pattern used byTcpStream,UnixStream, andPipe.The implementation delegates to the file's internal
SharedFd:as_reader_fd()-> wrapsself.fdinSharedFdWrapperas_writer_fd()-> wrapsself.fdinSharedFdWrapperThis enables
file.splice_to_pipe()andfile.splice_from_pipe()calls.