(&self, vm: &VirtualMachine)
| 1005 | } |
| 1006 | |
| 1007 | fn _db_lock(&self, vm: &VirtualMachine) -> PyResult<PyMappedMutexGuard<'_, Sqlite>> { |
| 1008 | let guard = self.db.lock(); |
| 1009 | if guard.is_some() { |
| 1010 | Ok(PyMutexGuard::map(guard, |x| unsafe { |
| 1011 | x.as_mut().unwrap_unchecked() |
| 1012 | })) |
| 1013 | } else { |
| 1014 | Err(new_programming_error( |
| 1015 | vm, |
| 1016 | "Base Connection.__init__ not called.".to_owned(), |
| 1017 | )) |
| 1018 | } |
| 1019 | } |
| 1020 | |
| 1021 | #[pymethod] |
| 1022 | fn cursor( |
no test coverage detected