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

Method callback_result_from_method

crates/stdlib/src/_sqlite3.rs:618–644  ·  view source on GitHub ↗
(
            context: SqliteContext,
            instance: &PyObject,
            name: &str,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

616 }
617
618 fn callback_result_from_method(
619 context: SqliteContext,
620 instance: &PyObject,
621 name: &str,
622 vm: &VirtualMachine,
623 ) {
624 let f = || -> PyResult<()> {
625 let val = vm.call_method(instance, name, ())?;
626 context.result_from_object(&val, vm)
627 };
628
629 if let Err(exc) = f() {
630 if exc.fast_isinstance(vm.ctx.exceptions.attribute_error) {
631 context.result_exception(
632 vm,
633 exc,
634 &format!("user-defined aggregate's '{name}' method not defined\0"),
635 )
636 } else {
637 context.result_exception(
638 vm,
639 exc,
640 &format!("user-defined aggregate's '{name}' method raised error\0"),
641 )
642 }
643 }
644 }
645
646 fn call_method_with_args(
647 context: SqliteContext,

Callers

nothing calls this directly

Calls 5

result_from_objectMethod · 0.80
fast_isinstanceMethod · 0.80
result_exceptionMethod · 0.80
fFunction · 0.50
call_methodMethod · 0.45

Tested by

no test coverage detected