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

Method clone_ref

src/python.rs:107–110  ·  view source on GitHub ↗
(&self, py: Python)

Source from the content-addressed store, hash-verified

105{
106 #[inline]
107 fn clone_ref(&self, py: Python) -> T {
108 let ptr = self.as_object().as_ptr();
109 unsafe { T::unchecked_downcast_from(PyObject::from_borrowed_ptr(py, ptr)) }
110 }
111}
112
113impl<T> PyClone for Option<T>

Callers 1

steal_ptrMethod · 0.45

Calls 3

mapMethod · 0.80
as_ptrMethod · 0.45
as_objectMethod · 0.45

Tested by

no test coverage detected