nrc / owned-buf

An owned buffer type for reading into possibly uninitialized memory
Apache License 2.0
2 stars 1 forks source link

Could this crate also define AsyncRead and AsyncWrite equivalents using the new types? #11

Closed FrankReh closed 1 year ago

FrankReh commented 1 year ago

Would it be appropriate for this crate to also define equivalents of AsyncRead and AsyncWrite?

I was curious which concrete buffer types would make up the input and output, and how the implicitly returned read or write length parameter is gleaned.

nrc commented 1 year ago

Yes, sort of. There is a design for async Read and Write traits using this buffer, specifically for io_uring, iocp, and similar: https://github.com/nrc/portable-interoperable/tree/master/io-traits#owned-read. The concrete buffer type is up to the user. The length parameter is going to be the filled length in the owned buffer (if it is not possible how to get that, then it might be a bug in the design.)

FrankReh commented 1 year ago

Thanks for the link.