(
py: Python,
directory: Option<String>,
)
| 9 | use crate::{ClientContextPtr, HqClientContext, borrow_mut, run_future}; |
| 10 | |
| 11 | pub(crate) fn connect_to_server_impl( |
| 12 | py: Python, |
| 13 | directory: Option<String>, |
| 14 | ) -> PyResult<ClientContextPtr> { |
| 15 | let directory = directory |
| 16 | .map(|p| -> PathBuf { p.into() }) |
| 17 | .unwrap_or_else(default_server_directory_path); |
| 18 | |
| 19 | run_future(async move { |
| 20 | let session = get_client_session(&directory).await?; |
| 21 | let context = HqClientContext { session }; |
| 22 | Py::new(py, context) |
| 23 | }) |
| 24 | } |
| 25 | |
| 26 | pub(crate) fn stop_server_impl(py: Python, ctx: ClientContextPtr) -> PyResult<()> { |
| 27 | run_future(async move { |
no test coverage detected