20 static auto reserve(U *req) {
21 auto ptr =
static_cast<T *
>(req->data)->shared_from_this();
27 static void defaultCallback(U *req,
int status) {
28 if(
auto ptr = reserve(req); status) {
35 template<
typename F,
typename... Args>
36 auto invoke(F &&f, Args &&...args) {
37 if constexpr(std::is_void_v<std::invoke_result_t<F, Args...>>) {
38 std::forward<F>(f)(std::forward<Args>(args)...);
41 if(
auto err = std::forward<F>(f)(std::forward<Args>(args)...); err) {
66 return (0 == uv_cancel(this->
template get<uv_req_t>()));
73 std::size_t
size() const noexcept {
74 return uv_req_size(this->
template get<uv_req_t>()->
type);