Basically the "caller borrowing a mutable buffer to the interface" doesn't work really well with io_uring, and since io_uring itself can manage buffers, putting the existing model upside-down with the caller borrowing from the interface, may be the best option
May I suggest an interface based/inspired upon AsyncBufRead? https://without.boats/blog/io-uring/
Basically the "caller borrowing a mutable buffer to the interface" doesn't work really well with
io_uring
, and sinceio_uring
itself can manage buffers, putting the existing model upside-down with the caller borrowing from the interface, may be the best option