|
| | file_async (native_handle_type handle) |
| | 构造函数
|
|
| ~file_async () |
| | 析构函数
|
| | file_async (file_async &&other) noexcept |
| | 移动构造函数
|
| file_async & | operator= (file_async &&other) noexcept |
| | 移动赋值运算符
|
| void | async_read (io_context &ctx, string &buffer, size_type size, function< void(error_code, size_type)> handler) |
| | 异步读取数据
|
| void | async_read (io_context &ctx, string &buffer, size_type size, difference_type offset, function< void(error_code, size_type)> handler) |
| | 指定偏移量异步读取数据
|
| void | async_read (io_context &ctx, string &buffer, size_type size, cancellation_slot &slot, function< void(error_code, size_type)> handler) |
| | 带取消槽异步读取数据
|
| void | async_write (io_context &ctx, string data, size_type size, function< void(error_code, size_type)> handler) |
| | 异步写入数据
|
| void | async_write (io_context &ctx, string data, size_type size, difference_type offset, function< void(error_code, size_type)> handler) |
| | 指定偏移量异步写入数据
|
| void | async_write (io_context &ctx, string data, size_type size, cancellation_slot &slot, function< void(error_code, size_type)> handler) |
| | 带取消槽异步写入数据
|
| native_handle_type | native_handle () const noexcept |
| | 获取原生文件句柄
|
文件异步I/O管理类
提供对文件句柄的异步读写操作,由 io_context 事件循环驱动。 handler 在 io_context::run() 线程中执行。
- 注解
- 不持有文件句柄所有权,句柄生命周期由调用方保证。
在文件 file_async.hpp 第 34 行定义.