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

Method step_callback

crates/stdlib/src/_sqlite3.rs:474–498  ·  view source on GitHub ↗
(
            context: *mut sqlite3_context,
            argc: c_int,
            argv: *mut *mut sqlite3_value,
        )

Source from the content-addressed store, hash-verified

472 }
473
474 unsafe extern "C" fn step_callback(
475 context: *mut sqlite3_context,
476 argc: c_int,
477 argv: *mut *mut sqlite3_value,
478 ) {
479 let context = SqliteContext::from(context);
480 let (cls, vm) = unsafe { (*context.user_data::<Self>()).retrieve() };
481 let args = unsafe { core::slice::from_raw_parts(argv, argc as usize) };
482 let instance = context.aggregate_context::<*const PyObject>();
483 if unsafe { (*instance).is_null() } {
484 match cls.call((), vm) {
485 Ok(obj) => unsafe { *instance = obj.into_raw().as_ptr() },
486 Err(exc) => {
487 return context.result_exception(
488 vm,
489 exc,
490 "user-defined aggregate's '__init__' method raised error\0",
491 );
492 }
493 }
494 }
495 let instance = unsafe { &**instance };
496
497 Self::call_method_with_args(context, instance, "step", args, vm);
498 }
499
500 unsafe extern "C" fn finalize_callback(context: *mut sqlite3_context) {
501 let context = SqliteContext::from(context);

Callers

nothing calls this directly

Calls 5

retrieveMethod · 0.80
result_exceptionMethod · 0.80
callMethod · 0.45
as_ptrMethod · 0.45
into_rawMethod · 0.45

Tested by

no test coverage detected