Read a file from the workspace.
(&self, py: Python<'_>, path: String)
| 2045 | |
| 2046 | /// Read a file from the workspace. |
| 2047 | fn read_file(&self, py: Python<'_>, path: String) -> PyResult<String> { |
| 2048 | let session = self.inner.clone(); |
| 2049 | py.allow_threads(move || get_runtime().block_on(session.read_file(&path))) |
| 2050 | .map_err(|e| PyRuntimeError::new_err(format!("{e}"))) |
| 2051 | } |
| 2052 | |
| 2053 | /// Write a file in the workspace. |
| 2054 | fn write_file(&self, py: Python<'_>, path: String, content: String) -> PyResult<PyToolResult> { |
no test coverage detected