This PR implements AsyncReadRent and AsyncWriteRent for File, completing the following tasks:
[x] Updated op::read<T> and op::write<T> to support reading/writing files using the file pointer.
Also modified the implementation of read and read_at on Windows:
Utilized the OVERLAPPED struct to reduce the number of syscalls.
[x] Fixed the bug where readv and writev would always start from the beginning of the file.
[x] Removed the incorrect implementation of readv and writev on Windows.
Simulated readv and writev by continually calling the read and write functions.
[x] Updated the documentation for AsyncWriteRent and AsyncReadRent.
[x] Due to the lack of readv/writev-like syscalls on the Windows platform, the structure of src/fs/file.rs was changed for better readability of the implementations on different platforms.
This PR implements AsyncReadRent and AsyncWriteRent for File, completing the following tasks:
op::read<T>
andop::write<T>
to support reading/writing files using the file pointer.OVERLAPPED
struct to reduce the number of syscalls.readv
andwritev
would always start from the beginning of the file.readv
andwritev
on Windows.readv
andwritev
by continually calling theread
andwrite
functions.AsyncWriteRent
andAsyncReadRent
.readv/writev
-like syscalls on the Windows platform, the structure ofsrc/fs/file.rs
was changed for better readability of the implementations on different platforms.Other details are shown in the code.
Related Issue
266
291