(&self, py: Python, f: F)
| 53 | /// to touch any reference counts when the input object already is a Python object. |
| 54 | #[inline] |
| 55 | fn with_borrowed_ptr<F, R>(&self, py: Python, f: F) -> R |
| 56 | where |
| 57 | F: FnOnce(*mut ffi::PyObject) -> R, |
| 58 | { |
| 59 | let obj = self.to_py_object(py).into_object(); |
| 60 | let res = f(obj.as_ptr()); |
| 61 | obj.release_ref(py); |
| 62 | res |
| 63 | } |
| 64 | |
| 65 | // FFI functions that accept a borrowed reference will use: |
| 66 | // input.with_borrowed_ptr(|obj| ffi::Call(obj) |
nothing calls this directly
no test coverage detected