Open XVilka opened 4 months ago
Unfortunately an API taking a borrowed slice is not safe when it comes to async IO in Rust, because you can leak the Future and regain mutable access to the buffer while the kernel continues to read from it. It's the same problem as io-uring and other completion-based IO.
Currently, the method signature is
But it makes a requirement to allocate the buf, which isn't always welcome. I suggest also to support specifying
buf
as&[u8]
slice.