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

Interface Callable

crates/vm/src/types/slot.rs:1692–1714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1690
1691#[pyclass]
1692pub trait Callable: PyPayload {
1693 type Args: FromArgs;
1694
1695 #[inline]
1696 #[pyslot]
1697 fn slot_call(zelf: &PyObject, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
1698 let zelf = zelf.downcast_ref().ok_or_else(|| {
1699 let repr = zelf.repr(vm);
1700 let help: Wtf8Buf = if let Ok(repr) = repr.as_ref() {
1701 repr.as_wtf8().to_owned()
1702 } else {
1703 zelf.class().name().to_owned().into()
1704 };
1705 let mut msg = Wtf8Buf::from("unexpected payload for __call__ of ");
1706 msg.push_wtf8(&help);
1707 vm.new_type_error(msg)
1708 })?;
1709 let args = args.bind(vm)?;
1710 Self::call(zelf, args, vm)
1711 }
1712
1713 fn call(zelf: &Py<Self>, args: Self::Args, vm: &VirtualMachine) -> PyResult;
1714}
1715
1716#[pyclass]
1717pub trait GetDescriptor: PyPayload {

Callers 2

get_condition_matcherFunction · 0.50
sub_implMethod · 0.50

Implementers 14

_asyncio.rscrates/stdlib/src/_asyncio.rs
json.rscrates/stdlib/src/json.rs
_sqlite3.rscrates/stdlib/src/_sqlite3.rs
_operator.rscrates/vm/src/stdlib/_operator.rs
_functools.rscrates/vm/src/stdlib/_functools.rs
_typing.rscrates/vm/src/stdlib/_typing.rs
function.rscrates/vm/src/stdlib/_ctypes/function.
staticmethod.rscrates/vm/src/builtins/staticmethod.rs
genericalias.rscrates/vm/src/builtins/genericalias.rs
builtin_func.rscrates/vm/src/builtins/builtin_func.rs
weakref.rscrates/vm/src/builtins/weakref.rs
function.rscrates/vm/src/builtins/function.rs

Calls

no outgoing calls

Tested by

no test coverage detected