ToAsyncResult for (*mut T, usize) {
+ #[inline]
+ fn to_async_result(&self, ctx: *const c_void) -> CAsyncResult {
+ CAsyncResult {
+ ctx,
+ error: std::ptr::null_mut(),
+ data: self.0 as *mut c_void,
+ length: self.1,
+ userdata: std::ptr::null_mut(),
+ }
+ }
+}
+
+impl ToAsyncResult for () {
+ #[inline]
+ fn to_async_result(&self, ctx: *const c_void) -> CAsyncResult {
+ CAsyncResult {
+ ctx,
+ error: std::ptr::null_mut(),
+ data: std::ptr::null_mut(),
+ length: 0,
+ userdata: std::ptr::null_mut(),
+ }
+ }
+}
+
+pub(crate) fn execute_async(
+ callback: CAsyncCallback,
+ ctx: *const P,
+ userdata: *mut c_void,
+ fut: F,
+) where
+ F: Future