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

Method trace_callback

crates/stdlib/src/_sqlite3.rs:591–606  ·  view source on GitHub ↗
(
            _typ: c_uint,
            data: *mut c_void,
            stmt: *mut c_void,
            sql: *mut c_void,
        )

Source from the content-addressed store, hash-verified

589 }
590
591 unsafe extern "C" fn trace_callback(
592 _typ: c_uint,
593 data: *mut c_void,
594 stmt: *mut c_void,
595 sql: *mut c_void,
596 ) -> c_int {
597 let (callable, vm) = unsafe { (*data.cast::<Self>()).retrieve() };
598 let expanded = unsafe { sqlite3_expanded_sql(stmt.cast()) };
599 let f = || -> PyResult<()> {
600 let stmt = ptr_to_str(expanded, vm).or_else(|_| ptr_to_str(sql.cast(), vm))?;
601 callable.call((stmt,), vm)?;
602 Ok(())
603 };
604 let _ = f();
605 0
606 }
607
608 unsafe extern "C" fn progress_callback(data: *mut c_void) -> c_int {
609 let (callable, vm) = unsafe { (*data.cast::<Self>()).retrieve() };

Callers

nothing calls this directly

Calls 5

ptr_to_strFunction · 0.85
retrieveMethod · 0.80
fFunction · 0.50
castMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected