bytedance / monoio

Rust async runtime based on io-uring.
Apache License 2.0
3.98k stars 223 forks source link

Vectored IO for files #266

Open NKID00 opened 5 months ago

NKID00 commented 5 months ago

Is your feature request related to a problem? Please describe. Vectored IO for files is neither implemented directly nor through AsyncWriteRent and AsyncReadRent traits.

Describe the solution you'd like

Describe alternatives you've considered It is possible to emulate vectored write through multiple single writes, but that missed the point of using io_uring.

Additional context io_uring provides an option to specify offset for vectored IO but monoio's WriteVec and ReadVec op structs don't support it. We could add a new vectored IO op struct with offset or manipulate current op struct definition.

For tcp and unix sockets, vectored IO is implemented through AsyncWriteRent and AsyncReadRent.

Not implementing AsyncWriteRent and AsyncReadRent also causes BufWriter and BufReader to be unusable for files. See #133.

Xuanwo commented 4 months ago

For context, this issue arises from opendal's efforts to integrate with monoio-fs: https://github.com/apache/opendal/issues/4552