// the callback from IC dereferences the future from a raw pointer, assigns the
// result and calls the waker
the callback from IC dereferences the future from a raw pointer, assigns the
result and calls the waker
the callback from IC dereferences the future from a raw pointer assigns the result and calls the waker
fn callback(future_ptr: *mut ()) {
        let ref_counted = unsafe { RefCounted::from_raw(future_ptr as *const RefCell<CallFuture>) };
        let top_level_future = ref_counted.borrow_mut().top_level_future;
        let maybe_waker = {
            let mut future = ref_counted.borrow_mut();
            future.result = Some(match reject_code() {
                0 => Ok(arg_data()),
                n => Err((Some(n), reject_message())),
            });
            future.waker.take()
        };
        if let Some(waker) = maybe_waker {
            waker.wake();
        }
        std::mem::drop(ref_counted);
        if !top_level_future.is_null() {
            unsafe {
                TopLevelFuture::release(top_level_future);
            }
        }
    }
fn callback ( future_ptr : * mut ( ) ) { let ref_counted = unsafe { RefCounted :: from_raw ( future_ptr as * const RefCell < CallFuture > ) } ; let top_level_future = ref_counted . borrow_mut ( ) . top_level_future ; let maybe_waker = { let mut future = ref_counted . borrow_mut ( ) ; future . result = Some ( match reject_code ( ) { 0 => Ok ( arg_data ( ) ) , n => Err ( ( Some ( n ) , reject_message ( ) ) ) , } ) ; future . waker . take ( ) } ; if let Some ( waker ) = maybe_waker { waker . wake ( ) ; } std :: mem :: drop ( ref_counted ) ; if ! top_level_future . is_null ( ) { unsafe { TopLevelFuture :: release ( top_level_future ) ; } } }
the callback from IC dereferences the future from a raw pointer, assigns the
result and calls the waker
the callback from IC dereferences the future from a raw pointer assigns the result and calls the waker
future_ptr
*mut ()