-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vectored read and write support #58357
Conversation
Unix also supports vectored IO on files/stdout/etc, but I haven't plumbed that through yet. |
cc @carllerche |
8932b55
to
03fc79a
Compare
Seems a bit early to commit this to std. It looks like it is copying the API from |
It'll be landing as unstable so we can continue to tweak as needed, but I don't think there'll really need to be all that much. The design space here is pretty constrained, and when talking about this at the all hands last week, we were all in agreement that the current iovec approach of DST hackery to avoid separate immutable and mutable types wasn't worth it. The other possibilities are this and |
This looks great to me, thanks @sfackler! I think I personally prefer the current approach over One thing I think though we'll still want to game out is the extension traits for Unix/Windows perhaps? Ideally those would be used internally as well to avoid pointer casts |
src/libstd/io/mod.rs
Outdated
/// # Panics | ||
/// | ||
/// Panics on Windows if the slice is larger than 4GB. | ||
#[unstable(feature = "iovec", issue = "0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder to fill out the issue before merging
The extension trait would be on |
Oh, we may not actually want those extension traits, since we'd need to expose |
We don't necessarily need an extension trait but rather a free function. Thinking about it though a pointer cast is likely required anyway because the |
I just changed them to implement Deref/DerefMut. It makes the code a bit nicer. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Uh, why are doc links broken? |
I suspect that has to do with deref inlining methods or something like that, although beyond that I'm not sure why the links are broken In any case r=me with a tracking issue filed |
@QuietMisdreavus do you know what's going on with the link checker up above? |
This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies.
Returning &'a mut [u8] was unsound, and we may as well just have them directly deref to their slices to make it easier to work with them.
b3b5eaf
to
034de8d
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
9c76f7b
to
5ca3b00
Compare
@bors r=alexcrichton |
📌 Commit 5ca3b00 has been approved by |
3c8c835
to
c5b87a2
Compare
@bors r=alexcrichton |
📌 Commit c5b87a2 has been approved by |
⌛ Testing commit c5b87a2 with merge dc00640b2c9aaeedc49ac03d44e710037d8a8285... |
💔 Test failed - checks-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors r=alexcrichton |
📌 Commit 4785c74 has been approved by |
Add vectored read and write support This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies. r? @alexcrichton
☀️ Test successful - checks-travis, status-appveyor |
☀️ Test successful - checks-travis, status-appveyor |
This functionality has lived for a while in the tokio ecosystem, where
it can improve performance by minimizing copies.
r? @alexcrichton