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

Method set_progress_handler

crates/stdlib/src/_sqlite3.rs:1418–1440  ·  view source on GitHub ↗
(
            &self,
            callable: PyObjectRef,
            n: c_int,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

1416
1417 #[pymethod]
1418 fn set_progress_handler(
1419 &self,
1420 callable: PyObjectRef,
1421 n: c_int,
1422 vm: &VirtualMachine,
1423 ) -> PyResult<()> {
1424 let db = self.db_lock(vm)?;
1425 let Some(data) = CallbackData::new(callable, vm) else {
1426 unsafe { sqlite3_progress_handler(db.db, n, None, null_mut()) };
1427 return Ok(());
1428 };
1429
1430 unsafe {
1431 sqlite3_progress_handler(
1432 db.db,
1433 n,
1434 Some(CallbackData::progress_callback),
1435 Box::into_raw(Box::new(data)).cast(),
1436 )
1437 };
1438
1439 Ok(())
1440 }
1441
1442 #[pymethod]
1443 fn iterdump(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult {

Calls 4

newFunction · 0.85
db_lockMethod · 0.80
SomeClass · 0.50
castMethod · 0.45