MCPcopy Index your code
hub / github.com/RustPython/RustPython / _db_lock

Method _db_lock

crates/stdlib/src/_sqlite3.rs:1007–1019  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

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(

Callers 4

db_lockMethod · 0.80
interruptMethod · 0.80
in_transactionMethod · 0.80
total_changesMethod · 0.80

Calls 4

ErrClass · 0.50
lockMethod · 0.45
as_mutMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected