(
outcome: FlowResult<Result<Json, PyValueFuture>>,
)
| 61 | } |
| 62 | |
| 63 | async fn resolve_json_or_future( |
| 64 | outcome: FlowResult<Result<Json, PyValueFuture>>, |
| 65 | ) -> FlowResult<Json> { |
| 66 | match outcome? { |
| 67 | Ok(json) => Ok(json), |
| 68 | Err(future) => { |
| 69 | let py_result = future |
| 70 | .await |
| 71 | .map_err(|e| FlowError::Internal(e.to_string()))?; |
| 72 | Python::attach(|py| { |
| 73 | py_to_json(py_result.bind(py)) |
| 74 | .map_err(|e: PyErr| FlowError::Internal(e.to_string())) |
| 75 | }) |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | fn split_py_object_or_future( |
| 81 | py: Python<'_>, |
no test coverage detected