(&self, py: Python<'_>)
| 141 | |
| 142 | #[pyo3(signature = () -> "object", text_signature = "() -> object")] |
| 143 | fn report(&self, py: Python<'_>) -> PyResult<Py<PyAny>> { |
| 144 | let guard = self.inner.try_lock().map_err(|_| { |
| 145 | pyo3::exceptions::PyRuntimeError::new_err( |
| 146 | "adaptive runtime is locked by an async operation; try again after await completes", |
| 147 | ) |
| 148 | })?; |
| 149 | let state = guard.as_ref().ok_or_else(|| { |
| 150 | pyo3::exceptions::PyRuntimeError::new_err("adaptive runtime already shut down") |
| 151 | })?; |
| 152 | let report = match state { |
| 153 | PyAdaptiveRuntimeState::Pending { report, .. } => report, |
| 154 | PyAdaptiveRuntimeState::Ready(runtime) => runtime.report(), |
| 155 | }; |
| 156 | let report = serde_json::to_value(report) |
| 157 | .map_err(|e| pyo3::exceptions::PyRuntimeError::new_err(e.to_string()))?; |
| 158 | json_to_py(py, &report) |
| 159 | } |
| 160 | |
| 161 | #[pyo3( |
| 162 | signature = ( |
nothing calls this directly
no test coverage detected