(async_iter: &Arc<Py<PyAny>>)
| 101 | } |
| 102 | |
| 103 | fn next_async_iter_coro(async_iter: &Arc<Py<PyAny>>) -> FlowResult<Option<Py<PyAny>>> { |
| 104 | Python::attach(|py| { |
| 105 | let iter = async_iter.bind(py); |
| 106 | match iter.call_method0("__anext__") { |
| 107 | Ok(coro) => Ok(Some(coro.unbind())), |
| 108 | Err(error) => { |
| 109 | if error.is_instance_of::<pyo3::exceptions::PyStopAsyncIteration>(py) { |
| 110 | Ok(None) |
| 111 | } else { |
| 112 | Err(FlowError::Internal(error.to_string())) |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | }) |
| 117 | } |
| 118 | |
| 119 | async fn await_async_iter_value(coro: Py<PyAny>) -> FlowResult<Option<Json>> { |
| 120 | let future = Python::attach(|py| { |
no outgoing calls
no test coverage detected