Skip to content
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

io: add AsyncWriteExt::write_vectored #3678

Merged
merged 1 commit into from
Apr 5, 2021
Merged

Conversation

davidpdrsn
Copy link
Member

@davidpdrsn davidpdrsn commented Apr 5, 2021

Fixes #3676

cc @kaimast

@davidpdrsn davidpdrsn added the A-tokio Area: The main tokio crate label Apr 5, 2021
Comment on lines +14 to +19
pub struct WriteVectored<'a, 'b, W: ?Sized> {
writer: &'a mut W,
bufs: &'a [IoSlice<'b>],
// Make this future `!Unpin` for compatibility with async trait methods.
#[pin]
_pin: PhantomPinned,
Copy link
Member Author

Choose a reason for hiding this comment

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

tbh I'm not totally sure we need two lifetimes here. The test case in the docs works where both are 'a but not sure if that could break some use cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer having both lifetimes.

@Darksonn Darksonn added the M-io Module: tokio/io label Apr 5, 2021
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

This seems good to me. 👍

Do we want a write_all_vectored too?

@davidpdrsn
Copy link
Member Author

Do we want a write_all_vectored too?

Yeah that would be cool. I'll make an issue to add it.

@davidpdrsn davidpdrsn merged commit eabb7ce into master Apr 5, 2021
@davidpdrsn davidpdrsn deleted the david/write-vectored-util branch April 5, 2021 22:02
@kaimast
Copy link

kaimast commented Apr 5, 2021

Wow. That was super quick. Thanks a lot!

@Darksonn Darksonn mentioned this pull request Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add vectored utility fns to AsyncWriteExt
3 participants