|
| std::unique_ptr< uv_fs_t > | req_ |
| std::coroutine_handle | handle_ |
| std::optional< ssize_t > | result_ = std::nullopt |
◆ FileOpAwaiter_() [1/3]
| uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::FileOpAwaiter_ |
( |
| ) |
|
|
inline |
52:
req_{std::make_unique<uv_fs_t>()} {}
std::unique_ptr< uv_fs_t > req_
Definition fs.cc:104
◆ FileOpAwaiter_() [2/3]
| uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::FileOpAwaiter_ |
( |
const FileOpAwaiter_ & | | ) |
|
|
delete |
◆ FileOpAwaiter_() [3/3]
| uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::FileOpAwaiter_ |
( |
FileOpAwaiter_ && | | ) |
|
|
delete |
◆ ~FileOpAwaiter_()
| uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::~FileOpAwaiter_ |
( |
| ) |
|
|
inline |
60 {
62
64
65 uv_cancel((uv_req_t *)
req_.release());
66 } else {
67 uv_fs_req_cleanup(
req_.get());
68 }
69 }
void resetRequestData(Request *req)
Definition internal_utils.h:95
bool requestDataIsNull(Request *req)
Check if request data is null.
Definition internal_utils.h:107
◆ await_ready()
| bool uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::await_ready |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
75 {
77 }
std::optional< ssize_t > result_
Definition fs.cc:106
◆ await_resume()
| void uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::await_resume |
( |
| ) |
|
|
inline |
The callback is guaranteed to have been called once the awaiting coroutine is resumed.
90 {
96 "file operation failed");
98 throw UvcoException(UV_EAGAIN,
99 "file operation not yet finished (this is a bug)");
100 }
101 }
int uv_status
Result of a libuv operation, an errno error code.
Definition internal_utils.h:22
◆ await_suspend()
| bool uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::await_suspend |
( |
std::coroutine_handle<> | handle | ) |
|
|
inline |
79 {
81 BOOST_ASSERT_MSG(!
handle_,
"FileOpAwaiter_ can only be awaited once");
85 return true;
86 }
std::coroutine_handle handle_
Definition fs.cc:105
void setRequestData(Request *req, Data *data)
Set data pointer on request.
Definition internal_utils.h:90
◆ onFileOpDone()
| void uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::onFileOpDone |
( |
uv_fs_t * | req | ) |
|
|
inlinestaticprivate |
36 {
38 if (awaiter == nullptr) {
39
40 uv_fs_req_cleanup(
req);
42 return;
43 }
44 if (
req->result == UV_ECANCELED) {
45 return;
46 }
47 awaiter->result_ =
req->result;
48 awaiter->schedule();
49 }
uv_fs_t & req()
Obtain the uv_fs_t struct to fill in before starting the operation.
Definition fs.cc:72
Into * getRequestDataOrNull(const Request *req)
Definition internal_utils.h:69
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ req()
| uv_fs_t & uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::req |
( |
| ) |
|
|
inlinenodiscard |
Obtain the uv_fs_t struct to fill in before starting the operation.
◆ schedule()
| void uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::schedule |
( |
| ) |
|
|
inlineprivate |
108 {
112 }
113 }
static void enqueue(std::coroutine_handle<> handle)
Definition loop.cc:94
◆ uvCallback()
| uv_fs_cb uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::uvCallback |
( |
| ) |
|
|
inlinestaticnodiscard |
static void onFileOpDone(uv_fs_t *req)
Definition fs.cc:36
◆ handle_
| std::coroutine_handle uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::handle_ |
|
private |
◆ req_
| std::unique_ptr<uv_fs_t> uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::req_ |
|
private |
◆ result_
| std::optional<ssize_t> uvco::anonymous_namespace{fs.cc}::FileOpAwaiter_::result_ = std::nullopt |
|
private |
The documentation for this class was generated from the following file: