MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / call

Method call

src/objectprotocol.rs:210–217  ·  view source on GitHub ↗
(&self, py: Python, args: A, kwargs: Option<&PyDict>)

Source from the content-addressed store, hash-verified

208 /// * otherwise, a Rust tuple with 1 or more elements
209 #[inline]
210 fn call<A>(&self, py: Python, args: A, kwargs: Option<&PyDict>) -> PyResult<PyObject>
211 where
212 A: ToPyObject<ObjectType = PyTuple>,
213 {
214 args.with_borrowed_ptr(py, |args| unsafe {
215 err::result_from_owned_ptr(py, ffi::PyObject_Call(self.as_ptr(), args, kwargs.as_ptr()))
216 })
217 }
218
219 /// Calls a method on the object.
220 /// This is equivalent to the Python expression: 'self.name(*args, **kwargs)'

Callers 1

call_methodMethod · 0.45

Implementers 1

objectprotocol.rssrc/objectprotocol.rs

Calls 3

result_from_owned_ptrFunction · 0.85
with_borrowed_ptrMethod · 0.45
as_ptrMethod · 0.45

Tested by

no test coverage detected