例
unsafe extern "C" fn _pen_foo(
stack: *mut ffi::cps::Stack,
continuation: extern "C" fn(*mut ffi::cps::Stack, f64) -> ffi::cps::Result,
) -> ffi::cps::Result {
let context = stack.async_context();
let future = if let Some(future) = restore() {
future
} else {
foo()
};
let value = match future.poll(context) {
Poll::Ready(value) => value,
Poll::Pending => {
save(future);
return ffi::cps::Result::new(...);
},
}
continuation(stack, value)
}