diff options
Diffstat (limited to 'core/ops_json.rs')
-rw-r--r-- | core/ops_json.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/ops_json.rs b/core/ops_json.rs index 22a84154d..0ca7e5ce4 100644 --- a/core/ops_json.rs +++ b/core/ops_json.rs @@ -32,9 +32,10 @@ pub fn void_op_async() -> Box<OpFn> { // to deserialize to the unit type instead of failing with `ExpectedNull` // op_async(|_, _: (), _: ()| futures::future::ok(())) Box::new(move |state, payload| -> Op { + let op_id = payload.op_id; let pid = payload.promise_id; let op_result = serialize_op_result(Ok(()), state); - Op::Async(Box::pin(futures::future::ready((pid, op_result)))) + Op::Async(Box::pin(futures::future::ready((pid, op_id, op_result)))) }) } @@ -112,6 +113,7 @@ where RV: Serialize + 'static, { Box::new(move |state, payload| -> Op { + let op_id = payload.op_id; let pid = payload.promise_id; // Deserialize args, sync error on failure let args = match payload.deserialize() { @@ -124,7 +126,7 @@ where use crate::futures::FutureExt; let fut = op_fn(state.clone(), a, b) - .map(move |result| (pid, serialize_op_result(result, state))); + .map(move |result| (pid, op_id, serialize_op_result(result, state))); Op::Async(Box::pin(fut)) }) } @@ -143,6 +145,7 @@ where RV: Serialize + 'static, { Box::new(move |state, payload| -> Op { + let op_id = payload.op_id; let pid = payload.promise_id; // Deserialize args, sync error on failure let args = match payload.deserialize() { @@ -155,7 +158,7 @@ where use crate::futures::FutureExt; let fut = op_fn(state.clone(), a, b) - .map(move |result| (pid, serialize_op_result(result, state))); + .map(move |result| (pid, op_id, serialize_op_result(result, state))); Op::AsyncUnref(Box::pin(fut)) }) } |